We are trying to remove the trailing slash from our URLs (primarily so that duplicate content is not being served).
I know there are many tutorials about how to do this, and I have succeeded in changing the core code so all links are to non-slash URLs. However I am struggling to do the rewrites for anyone who follows a link (or enters one manually) with the trailing slash.
All the tutorials I have read say to change the htaccess file, which after much digging I found out is not being used on our server. So I’m trying to use a rewrite in the DOMAIN.conf file (which is pulled in to the nginx.conf file).
I proposed this to our server hosts;
But they said: “That appears to be correct, however we do not support this.” and gave me a link to an online htaccess tester.Code:rewrite ^/(.*)/$ /$1 permanent;
Currently our .conf file contains this;
(edited to remove certain things and shortened to relevant info).server {
listen <server IP>:80;
server_name www.DOMAIN.co.uk;
root <server root>;
location / {
index index.html index.php;
try_files $uri $uri/ @handler;
expires 30d;
#auth_basic “Restricted”;
#auth_basic_user_file /var/www/htpasswd;
}
location /app/ { deny all; }
location /includes/ { deny all; }
location /lib/ { deny all; }
location /media/downloadable/ { deny all; }
location /pkginfo/ { deny all; }
location /report/config.xml { deny all; }
location /var/ { deny all; }
location /. {
return 404;
}
location @handler {
rewrite / /index.php;
}
location ~ .php/ {
rewrite ^(.*.php)/ $1 last;
}
location ~ .php$ {
if (!-e $request_filename) { rewrite / /index.php last; }
expires off;
fastcgi_pass <password>;
fastcgi_param HTTPS $fastcgi_https;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
# fastcgi_param MAGE_RUN_CODE default;
# fastcgi_param MAGE_RUN_TYPE store;
include fastcgi_params;
}
##
# SEO REWRITES
##
...............
Can anyone help with what the rewrite would need to be?View more threads in the same category:
- buy real drivers license(https://legitcleandocs.com)buy Austria id card, passports
- Buy Real Passport Online https://worldpassporte.com
- Kaufen Sie echte und gefälschte Pässe (https://legitcleandocs.com) Führerschein, Aufe
- CUMPĂRĂ PASAPORT ONLINE https://worldpassporte.com/
- Redirection problem after a payment
- buy a Canadian(https://qualitydocky.com) passport, French passport, Italian passport
- buy a USA passport(https://legitcleandocs.com)UK passport, Australia passport, German
- Falschgeld kaufen in essen WhatsApp….. +48 52 553 13 32 or KAUFEN SIE EINEN ECHTEN RE
- buy a US passport online( https://qualitydocky.com) buy UK p
- Buy eu pasport and driver's license online
Bookmarks