elearn
By:
elearn

How to write the rewrite rule in /etc/apache2/apache2.conf?

September 20, 2015 841 views
Apache

To make http://127.0.0.1/wp jump to http://127.0.0.1:8080/wp ,and 127.0.0.1/wp jump to 127.0.0.1:8080/wp ,how to write the rewrite rule in /etc/apache2/apache2.conf
?

1 Answer

You can use the rewrite rule inside your vhost, something like this will work:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^12\.34\.56\.789$
RewriteRule ^(.*)$ http://www.127.0.0.1:8080/$1 [L,R=301]
Have another answer? Share your knowledge.