mgwalk
October 24, 2010, 2:29am
1
I get an error based off this Rewrite rule. Can someone help me with this?
My ReWrite Rule
RewriteRule products/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ temp_products.php?vendor=$1&title=$2&sku=$3 [L]
My Referer LOG
[2010/10/23 - 21:51:56 -0400]ÿ- -> /products/vendor/item-name/sku/
[2010/10/23 - 21:51:56 -0400]ÿhttp://domain.com/products/vendor/item-name/sku/ -> /products/vendor/item-name/sku/
It should not goto /temp_not_found_404.php
My Error LOG
[Sat Oct 23 21:51:56 2010] [debug] mod_deflate.c(615): Zlib: Compressed 33738 to 6773 : URL /temp_products.php
[Sat Oct 23 21:51:56 2010] [error] File does not exist: /var/www/domain.com/products, referer: http://domain.com/products/vendor/item-name/sku/
[Sat Oct 23 21:51:56 2010] [debug] mod_deflate.c(615): Zlib: Compressed 15240 to 2993 : URL /temp_not_found_404.php, referer: http://domain.com/products/vendor/item-name/sku/
[Sat Oct 23 21:51:56 2010] [debug] mod_deflate.c(615): Zlib: Compressed 33738 to 6773 : URL /temp_products.php, referer: http://domain.com/products/vendor/item-name/sku/
Thanks
mgwalk
October 24, 2010, 5:56pm
2
dklynn,
So I should put the 301 at the end of all my RewriteRules?
Like this
[R=301,L]
Thanks dklynn for taking the time to respond and pointing this out
dklynn
October 24, 2010, 9:17pm
3
mg,
ONLY if you want to tell visitors (and search engines) about the redirection. Most often, that is NOT your intention. As in this case, however, it’s an excellent tool to use to check to be sure that the redirection is working - then remove the R=301 for the “production” code.
Regards,
DK
dklynn
October 24, 2010, 6:21am
4
mg,
RewriteRule products/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$ temp_products.php?vendor=$1&title=$2&sku=$3 [L]
That should take your URI, products/vendor/item-name/sku/ and change the URI to temp_products.php?vendor=vendor&title=item-name&sku=sku. Add R=301 to the Last flag and let us know whether the redirection is taking place or not.
Regards,
DK
mgwalk
October 24, 2010, 6:14am
5
Found the problem
The jQuery Plugin
cloud-zoom.1.0.2.min.js is adding a DIV
<div style="background-image:url(".");z-index: 999; position: absolute; width: 330px; height: 82px; left: 0px; top: 0px; cursor: move;" class="mousetrap"></div>
I removed
background-image:url(".");
in the cloud-zoom.1.0.2.min.js
Now it is like this when the page loads and my
<div style="z-index: 999; position: absolute; width: 330px; height: 82px; left: 0px; top: 0px; cursor: move;" class="mousetrap"></div>
Now my log file does not pass through the 404 file.
That took two hours to figure out.
Enjoy.