Forum Moderators: phranque

Message Too Old, No Replies

mod_rewrite and yahoo

Search engine lists pages without the "/"

         

Bonusbana

12:46 pm on Jan 29, 2005 (gmt 0)

10+ Year Member



Hi

I have a .htaccess file with mod_rewrite commands that looks something like:

RewriteRule ^([^/]+)/$ /index\.php?s1=$1

This works fine, and google lists the pages correctly like h**p://www.example.com/article/

But yahoo indexes the pages without the "/" in the end, and that causes a page not found error when people access the site from the yahoo SE.

I could add the following commands:

RewriteRule ^article$ article/ [R]

...but I have about 600 articles and I want to use a more generic redirect.

Does anyone have an answer for how to solve this?

marek

1:32 pm on Jan 29, 2005 (gmt 0)

10+ Year Member



What about:

RewriteRule ^([^./]+)$ $1/ [R]

It should work, provided virtual directories do not inculde a dot.

Bonusbana

1:45 pm on Jan 29, 2005 (gmt 0)

10+ Year Member



Thanks, I knew it would be something simple as that.

jdMorgan

4:56 pm on Jan 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Or just a slight change to the original rule:

RewriteRule ^([^/]+)[b]/?$[/b] /index\.php?s1=$1

Jim