WordPress.org

Support

Support » Plugins and Hacks » how to write configuration of htaccess to "virtual host" section in main config?

how to write configuration of htaccess to "virtual host" section in main config?

  • how to write configuration of htaccess to “virtual host” section in main config?
    i have tried once, but could not make it working, take in account that rules should change.

    why it is good to do so: apache would not search where .htaccess files exist and would not check whether it is changed, so it would work faster, take in account that searching file is relatively long and it checks subdirectories in path to file for .htaccess files.

Viewing 2 replies - 1 through 2 (of 2 total)
  • <VirtualHost *:80>
    	ServerName wp.localhost
    	ServerAlias *.wp.localhost
    	ServerAlias .....................
    	DocumentRoot /var/www/localhost/test/wpmu/
    ...
    ...
    ...
    	RewriteEngine On
    	RewriteLogLevel 9
    	RewriteLog /var/log/apache2/rewrite.log
    	<directory /var/www/localhost/test/wpmu/ >
    		#AllowOverride FileInfo Options Indexes
    		AllowOverride None
    
    		# BEGIN WordPress
    		RewriteRule ^index\.php$ - [L]
    		# uploaded files
    		RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    		RewriteCond %{REQUEST_FILENAME} -f [OR]
    		RewriteCond %{REQUEST_FILENAME} -d
    		RewriteRule ^ - [L]
    		RewriteRule . index.php [L]
    		# END WordPress
    	</directory>
    ....
    ...
    ...
    </VirtualHost>

    this does not work, but front page works.

    solved…
    “RewriteEngine On”
    should be both in <VirtualHost *:80>
    and in <directory /var/www/localhost/test/wpmu/ >
    . but when i delete rewritelog directive and other rewrite directives outside of “<directory…”, only “RewriteEngine On” in <directory /var/www/localhost/test/wpmu/ > is needed.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to write configuration of htaccess to "virtual host" section in main config?’ is closed to new replies.