Apache redirect with query string (.htaccess)
I am wanting to create some user friendly urls that redirect to dynamic pages (with query string values).
I can do want I want on my local server using Apache mod_rewrite, however I need to apply this to a hosted server. The hosted server allows .htaccess to use the mod_alias commands (e.g. RedirectMatch), but not mod_rewrite. Whenever I add: Code:
RewriteEngine on I tried using a RedirectMatch e.g.: Code:
RedirectMatch permanent ^/easy$ http://www.mydomain.com/phpscript.php?doc=213 Is there any way to keep the query string using RedirectMatch, or is there some other way of achieving this? Thanks |
Quote:
http://httpd.apache.org/docs/2.0/mod/mod_alias.html Quote:
|
I also thought it was odd that mod_alias was available, but mod_rewrite was not. I therefore contacted my hosting company and although they were not able to help in fixing the problem they did confirm that mod_rewrite was enabled.
I've therefore being playing around with the rule and I've found the problem. Although the example code was correct for use in httpd.conf (or equivalent vhost file) Code:
RewriteEngine on Code:
RewriteEngine on So all working correctly now. Thanks for your help. |
All times are GMT -5. The time now is 05:46 PM. |