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

Yesterday, I 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/download lagu
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,

Andrew
Just below the
Code: Select all
RewriteEngine On

you can do the following:
Code: Select all
RewriteCond %{REQUEST_FILENAME} !-d
# for testing
RewriteRule ^(.*)/$ /$1 [L,R]


For Production use the code as:
Code: Select all
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]


This should help you implement the "No Trailing Slash" policy.

Regards,
GXCPL (CTR)
Image
where innovation meets technology
2 posts Page 1 of 1
cron