I want to redirect " http: //localhost/b.html " β " http: //localhost/a.html " I tried RewriteRule for this. But for some reason this does not work for me.
I am using apache2, and my httpd.conf contains:
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
When I three " http: //localhost/a.html " He shows me a web page. But when I triend " http: //localhost/b.html " apache2 / error_log says "file does not exist: b.html" Is there any setting to enable rewrite_module?
RewriteRule. :
RewriteEngine On RewriteRule ^/b.html$ /a.html [L]
^b.html$
[L]
, Apache ( httpd.conf) Alias ββ VirtualHost:
AllowOverride All
, modrewrite, , :
AllowOverride None
.
virtualhost?
<VirtualHost *:80> RewriteEngine On RewriteRule ^/b.html$ /a.html </VirtualHost>
. :
"AllowOverride None" /etc/apache 2/sites-available/default "AllowOverride All".
Put the rewrite rule in /var/www/.htaccess instead of httpd.conf
I am not sure why it does not work in httpd.conf. But it works after doing the above two things.
Source: https://habr.com/ru/post/1706509/More articles:Working with Visual Fox Pro OleDb - c #Running PowerShell file in C #, how to do it in ASP.NET form? - c #Can I destroy a Flash object created with SWFObject? - flashJavascript not working in IE8 - javascriptHow to determine the playerβs aggressiveness in the game? - cJoomla 1.5 backup strategy - joomlaModelState controller with ModelStateWrappper - dependency-injectionHow to remove a command button using Word VBA? - vbaiTunes store - iPhone App ... customizable background? - iphonePassing javascript variable - javascriptAll Articles