/en/stuff/Michael_%E5%A4%A2_%E5%AF%A7%E5%BB%A3_Johnson_5574/
Above is my URL without the domain part.
My rule
RewriteRule ^([a-z]{2})/stuff/(.*)_([0-9]+)/?$ /search.php?lang=$1&ReviewID=$3 [QSA]
I keep getting this error
"The system cannot find the file specified."
Actually, I have no need for the name part, just the last number after the last underscore (the 5574 part). The other part is supposedly for Google to optimise its search or so I am told.
So if anyone can tell me what is wrong with my rule, that would be great.
I've seen the original post you have made earlier. I suppose escaping the % character by placing a backslash (\) before it in the previous regex would solve your problem.
http://www.webmasterworld.com/forum92/3174.htm
My latest URL, double urlencoded
/en/stuff/Michael_%25E5%25A4%25A2_%25E5%25AF%25A7%25E5%25BB%25A3_Johnson_5574/
My latest Rule
RewriteRule ^([a-z]{2})/stuff/([A-Za-z0-9\_\%]+)_([0-9]+)/?$ /search.php?lang=$1&ReviewID=$3 [QSA]
I have now backslash the underscore as well as the percent sign. Still same error.
I have double urlencode the URL because apparently the Rewrite Engine will urldecode it.
Originally posted by GIB:My latest URL, double urlencoded
/en/stuff/Michael_%25E5%25A4%25A2_%25E5%25AF%25A7%25E5%25BB%25A3_Johnson_5574/
My latest Rule
RewriteRule ^([a-z]{2})/stuff/([A-Za-z0-9\_\%]+)_([0-9]+)/?$ /search.php?lang=$1&ReviewID=$3 [QSA]
I have now backslash the underscore as well as the percent sign. Still same error.
I have double urlencode the URL because apparently the Rewrite Engine will urldecode it.
Oh damn it. I didn't know that mod_rewrite actually decodes the URL prior to matching them against the rewrite rules until I did some testing on my own just a while ago.
Hmm, how about using "^([a-z]{2})/stuff/.+_([0-9]+)/?$ /search.php?lang=$1&ReviewID=$2" instead?
Originally posted by LatecomerX:Oh damn it. I didn't know that mod_rewrite actually decodes the URL prior to matching them against the rewrite rules until I did some testing on my own just a while ago.
Hmm, how about using "^([a-z]{2})/stuff/.+_([0-9]+)/?$ /search.php?lang=$1&ReviewID=$2" instead?
Will give it a try tomorrow. Hope I don't have to go bang my head on the wall again. I banged almost the whole afternoon today.
Nope. Didn't work. Oh well, time to put on my crash helmet and go bang the walls.
Originally posted by GIB:Nope. Didn't work. Oh well, time to put on my crash helmet and go bang the walls.
Why bang the walls? They are not even female. I can't even believe you did it for the whole of last afternoon.
Anyway, I managed to get the rewrite rules working.
The .htaccess file in the lalala folder is written like:
RewriteEngine On
RewriteRule ([a-z]{2})/stuff/.+_([0-9]+)/?$ ../test.php?lang=$1&ReviewID=$2
And there's a test.php file in the gib folder which dumps the $_GET array. Try comparing it against your rewrite rules and keep us updated on this issue.
Originally posted by LatecomerX:Why bang the walls? They are not even female. I can't even believe you did it for the whole of last afternoon.
Anyway, I managed to get the rewrite rules working.
The .htaccess file in the lalala folder is written like:
RewriteEngine On
RewriteRule ([a-z]{2})/stuff/.+_([0-9]+)/?$ ../test.php?lang=$1&ReviewID=$2And there's a test.php file in the gib folder which dumps the $_GET array. Try comparing it against your rewrite rules and keep us updated on this issue.
Yes, I am using same RewriteRule and still same error. Maybe better I show u the real thing and my real .htaccess file. I will PM you the instructions on how to view the real thing.
I just tested on the live site that is using Apache and Debian Linux and it works. So the problem is Isapi Rewriter.