Forum Moderators: phranque

Message Too Old, No Replies

"/" in the text giving 404 error

"/" in the text giving 404 error

         

kirang

2:07 pm on Sep 22, 2009 (gmt 0)

10+ Year Member



Hello,

I had a url as :
http://test.example.com/gjsearchresult-q-category-Admin-jobs.html

which is working properly with the below rewrite rule

Now when i have the following url, it gives 404 error
http://www.example.com/gjsearchresult-q-category-QA%2FQC-jobs.html
(http://test.example.com/gjsearchresult-q-category-QA/QC-jobs.html)

My Rule is :

RewriteRule gjsearchresult-q-(.*)-category-(.*)-jobs\.html$ gjsearchresult.php?q=$1+category:($2)&l=&country=&js_radius=0&js_fromage= [L,NC]

What should i do to fix this problem? Any help will be appreciated.

Thanks,
Kiran Gupta.

[edited by: jdMorgan at 2:16 pm (utc) on Sep. 22, 2009]
[edit reason] example.com [/edit]

jdMorgan

2:22 pm on Sep 22, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You may need the "NoEscape" flag on the rule to prevent %2F from being re-encoded into %252F and causing your script to fail on lookup. With that change plus pattern improvements for much better efficiency, the rule would be:

RewriteRule ^gjsearchresult-q-(([^-]+)+)-category-(([^-]+)+)-jobs\.html$ /gjsearchresult.php?q=$1+category:([b]$3[/b])&l=&country=&js_radius=0&js_fromage= [NC,[b]NE[/b],L]

Jim