i am trying to write a RewriteRule in a .htaccess file.
i have several links on a page like:
Code: Select all
<a href="../search/?searchtext=Chatham&searchid=Search&type=8630&q=">Chatam</a>for search engine optimistation I want to write a RewriteRule such that if i pass through the link
Code: Select all
<a href="../8630/estate-agents/chatham/search-results/chatham-estate-agents.html">Chatam</a>in the above href ../8630/estate-agents/chatham/search-results/chatham-estate-agents.html, I am passing through the relevant values to run the query
I do not have the following file/folder on the server ../8630/estate-agents/chatham/search-results/chatham-estate-agents.html
the question is will this work?
I have tried to write the rule myself but eveytime I click the link ../8630/estate-agents/chatham/search-results/chatham-estate-agents.html I get a 404 error, this is because the file/folder does not exist
below is my attempt:
Code: Select all
RewriteEngine on
RewriteRule ^/([0-9]+)/([a-zA-Z]+)/([a-zA-Z]+)/([a-zA-Z]+)/(.*?).html$ /search/index.php?searchtext=$3&searchid=Search&type=$1