I am working on a project and I am stuck with some .htaccess
rewrite rule which is not working & I tried many things but no luck, so please help me.
Here is what I am doing:
when I open: domain.com/us/search.html?keyword=xyz&location=alabama
it should have to read the file search.php
from root directory & work like this: search.php?directory=us&keyword=xyz&location=alabama
it's properly getting subdirectory, but not getting keywords and location data.
Here is my .htaccess
code:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
RewriteRule ^(.*)/(.*)-ad(.*).html ad.php?countrycode=$1&title=$2&id=$3 [NC]
RewriteRule ^(.*)/$ country.php?countrycode=$1 [NC]
RewriteRule ^(.*)/(.*)-author\.html author.php?countrycode=$1&q=$2 [NC]
RewriteRule ^(.*)/(.*)-author/currentpage=(.*) author.php?countrycode=$1&q=$2¤tpage=$3 [NC]
RewriteRule ^(.*)/search\.html?keyword=(.*)&location=(.*) search.php?countrycode=$1&keyword=$2&location=$3 [NC,L]
RewriteRule ^(.*)/search\.html$ search.php?countrycode=$1 [NC,L]
RewriteRule ^(.*)/latest\.html$ latest.php?countrycode=$1 [NC,L]
RewriteRule ^(.*)/submit\.html$ submit.php [NC,L]
RewriteRule ^error\.html$ error.php [NC,L]
ErrorDocument 400 /error.html
ErrorDocument 401 /error.html
ErrorDocument 403 /error.html
ErrorDocument 404 /error.html
ErrorDocument 500 /error.html