Forum Moderators: open

Message Too Old, No Replies

Inktomi trailing slash and mod_rewrite

What's the solution?

         

Christopher C

5:05 am on Jun 9, 2004 (gmt 0)

10+ Year Member



Hello,

My site (which heavily uses mod_rewrite) is generating a lot of 404 errors because inktomi is stripping the trailing slash off of my urls.

i.e. Yahoo is referring visitors to:
widget/123/234/345

instead of properly to:
widget.com/123/234/345/

Is there an easy way to fix this?

Thanks,
Chris

CompressedAir

3:53 pm on Jun 12, 2004 (gmt 0)

10+ Year Member



Yes, you need to make your rule(s) give yahoo the same page whether or not the requested url has a trailing slash.
Something like this would work:

RewriteRule ^([a-zA-Z0-9-]+)[b]/?[/b]$ index.php?cat=$1 [L]

Good luck :)

Christopher C

5:47 pm on Jun 12, 2004 (gmt 0)

10+ Year Member



Thanks CA,

In the end I just ended up doubling the site of my .htaccess. There's too many pages indexed right now so don't want to deal with the working through the forwarding on each of them.

Cheers,
Chris

CompressedAir

4:26 pm on Jun 13, 2004 (gmt 0)

10+ Year Member



Sure :)
Oh ok. You wouldn't need to add this in addition to your other rules, just add the /?$, to your existing rules and it should work. Of course, always test first :)