Forum Moderators: phranque

Message Too Old, No Replies

trailing slash problem

         

imagined

7:52 pm on Dec 19, 2008 (gmt 0)

10+ Year Member



on my new website www.example.com i did some url rewriting to improve my ranking on search engines.

links work when i go to www.example.com/tutorials
but they DONT work if i go to www.example.com/tutorials/
how can i fix this?

i was recommended to redirect one to the other. what is best?
redirect
www.example.com/tutorials/
to
www.example.com/tutorials

or
www.example.com/tutorials
to
www.example.com/tutorials/

[edited by: jdMorgan at 8:29 pm (utc) on Dec. 19, 2008]
[edit reason] No URLs, please. Use example.com [/edit]

g1smd

8:17 pm on Dec 19, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If the URL is for a page, then it should not have a trailing slash.

If the URL is for the index page of a folder, then it should have a trailing slash.

imagined

9:04 pm on Dec 19, 2008 (gmt 0)

10+ Year Member



its a page.

but isn't better if i redirect it?

jdMorgan

9:32 pm on Dec 19, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> its a page.

redirect
www.example.com/<page>/
to
www.example.com/<page>

if /<page> exists as a file or does not exist as a directory. See Apache mod_rewrite RewriteCond -f and RewriteCond !-d

Jim