Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hi,

Just starting using Couch and loving it so far.

I have one question though - how do I ensure that URLs are always displayed without the trailing slash?

For example, I currently get:

www.mywebsite.com/about/
www.mywebsite.com/contact/

But I would like:

www.mywebsite.com/about
www.mywebsite.com/contact

This is my about page htaccess code:

#about.php
RewriteRule ^about$ "$0/" [R=301,L,QSA]
RewriteRule ^about/$ about.php [L,QSA]
RewriteRule ^about/.*?([^\.\/]*)\.html$ about.php?pname=$1 [L,QSA]
RewriteRule ^about/([1-2]\d{3})/(?:(0[1-9]|1[0-2])/(?:(0[1-9]|1[0-9]|2[0-9]|3[0-1])/)?)?$ about.php?d=$1$2$3 [L,QSA]
RewriteRule ^about/[^\.]*?([^/\.]*)/$ about.php?fname=$1 [L,QSA]
RewriteRule ^about/[^\.]*?([^/\.]*)$ "$0/" [R=301,L,QSA]

Thanks in advance,

Chris
www.mywebsite.com/about/ (with trailing slash, conventionally a directory)
www.mywebsite.com/about (without trailing slash, conventionally a file)

See also:
https://developers.google.com/search/bl ... t-to-slash
I get that, but how do I remove it, I don't tend to build sites with a trailing slash.
3 posts Page 1 of 1
cron