Forum Moderators: phranque

Message Too Old, No Replies

Modrewrite and Yahoo indexing errors

Yahoo indexing my site wrong and messing up my mod rewrite

         

mike_w

10:06 pm on Nov 19, 2004 (gmt 0)

10+ Year Member



I just did an new e-commerce site with a full mod rewrite. I saw inktomisearch bot crawl almost the entire site. but when I went to yahoo and looked at the actual url's that were indexed I saw that they indexed them completely wrong.

all the anchor text in the site completes the directories with a / at the end. (example <a href="home-decor/">...) but yahoo shows the results with out the / therefore destoying my mod rewrite pattern matching.

This is what I've got in my .htaccess

RewriteCond %{REQUEST_URI}!/db/$
RewriteCond %{REQUEST_URI}!/admin/$
RewriteCond %{REQUEST_URI}!/test_orders/$
RewriteCond %{REQUEST_URI}!/test_orders/db/$
RewriteRule ^(.*)/$ /category.php?mod_name=$1 [L]

the key is the RewriteRule ^(.*)/ <-----

I've tried to just add another rule to make up for the missing /
RewriteRule ^(.*)$ /category.php?mod_name=$1 [L]

but when I do I get a 500 error.

When users come in through these directories they are going to get a 404 error and shot right to the domain. That looks too much like a fantomaster cloak for my liking. Any help would be greatly appreaciated!

jdMorgan

10:21 pm on Nov 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



mike_w

Welcome to WebmasterWorld!

Check to see if your server has mod_dir loaded.
mod_dir will append missing slashes to directory requests.
Also check to see if your server is configured with UseCanonicalName on. If so, this can cause problems if the server path is not defined with a trailing slash. Try setting UseCanonicalName off.

These checks assume that you have access to httpd.conf. If not, ask your host to look into this.

You should also exclude category.php from the rewrite, so as to avoid a rewriting loop -- mod_rewrite in .htaccess behaves recursively. Change the last three lines to:


RewriteCond %{REQUEST_URI} !/test_orders/db/$
[b]RewriteCond %{REQUEST_URI} [i][/i]!^/category\.php$[/b]
RewriteRule ^(.*)[b]/?$[/b] /category.php?mod_name=$1 [L]

Jim

mike_w

11:01 pm on Nov 19, 2004 (gmt 0)

10+ Year Member



thanks jdmorgan

I'm contacting the host right now :)