I wish to redirect "http://localhost/b.html" --> "http://localhost/a.html" I attempted RewriteRule for your. But in some way it's not employed by me.
I'm using apache2 and my httpd.conf consists of:
LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule proxy_connect_module modules/mod_proxy_connect.so LoadModule rewrite_module modules/mod_rewrite.so RewriteEngine On RewriteRule ^/b.html$ http://localhost/a.html
After I tri "http://localhost/a.html" It shows me the site. However when I triend "http://localhost/b.html" apache2/error_log states "file doesn't exist: b.html" Does any setting missing make it possible for rewrite_module?
The issue is inside your RewriteRule. this will work:
RewriteEngine On RewriteRule ^/b.html$ /a.html [L]
the rule match ((this works inshtaccess, although not in server config)
^b.html$) mustn't range from the beginning slash.
- the rewrite target ought to be a family member URI if at all possible (i.e. on a single host)
- the rule should finish having a directive "how to proceedInch - within this situation
[L]eave processing (forget about rules is going to be processed)
Perhaps you have checked whether inside your Apache configuration file (probably httpd.conf) the directive for that Alias or VirtualHost section:
I'd exactly the same problem of modrewrite no longer working because I'd them back:
Best of luck.
Have you got it within the virtualhost section?
<VirtualHost *:80> RewriteEngine On RewriteRule ^/b.html$ /a.html </VirtualHost>
It really works now. Needed to do a couple of things:
Change "AllowOverride None" in /etc/apache2/sites-available/default to "AllowOverride All".
Place the rewrite rule in /var/www/.htaccess rather than httpd.conf
I don't know why it doesn't works in httpd.conf. However it works after doing the above mentioned a couple of things.