Hey all, just a simple question, which file can I put an rewrite rule into which will effect all domains. I use httpd.conf for an apache alias which affects all domains, but adding the rewrite rule does not. Where could I possibly insert it to effect all of my sites?
According to http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule , you can put it in the server config, virtual host, directory, .htaccess.
Hi Falko, I've read through the documentation and I'm adding the correct rules etc. The thing is, the code doesn't work in any file but the .vhost for specific domains. I want to achieve a mod rewrite which is applicable to every domain by setting the rule once is one file (httpd.conf). Surely this is a common action which people use. Have you got a rule which I can use and modify that effects all domains?
Hi Falko, I added these lines into httpd.conf which were taken straight from the domain's .vhost file. Apache is not throwing any errors at all. I have tested this rule in all the configuration files in the /etc/apache2/ directory but no luck. I am restarting apache every time I modify a file. Code: RewriteEngine on RewriteRule ^/admin$ http://%{HTTP_HOST}:8080/ [L,R=301]
Yes, httpd.conf is the main configuration file. I have other global setting in there that are working such as Alias etc.