apache - "RewriteEngine On" in virtual host not working -


This is my virtual host entry.

Version: Apache / 2.2.15 (Unix)

  & lt; VirtualHost *: 80 & gt; Server Name web1.net Server's www.web1.net ServerAdmin webmaster@web1.net DirectoryIndex index.html LogLevel index.php Alert Errorlog /var/log/httpd/web1.net_error_log CustomLog /var/log/httpd/web1.net_access_log Combined DocumentRoot / web / web1.net / htdocs & lt; Directory "/web/web1.net/htdocs"> Option Index Following similinks include ExecCGI order Allow, Allow all Allow override Allow all retargeting # This is not working on & lt; / Directory & gt; & Lt; / VirtualHost & gt;   

.htaccess file

  This works on reviant engine # # Abc5 RewriteCond% {HTTP_HOST} Example \ .org $ [nc] RewriteRule * Http: //www.example.com   

When I put in the same (on RewriteEngine).

Do I need any other changes in Apache configuration?

You < Code> is needed in .htaccess of each directory if you want to enable rewrite. So in a nutshell:

  • from the server config on RewriteEngine DocumentRoot / .htaccess
  • in DocumentRoot / .htaccess does not take effect for any /subdir/.htaccess RewriteEngine On

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -