WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
[resolved] how to write configuration of htaccess to "virtualhost" section o (3 posts)

  1. qdinar
    Member
    Posted 4 years ago #

    how to write configuration of wp-super-cache's htaccess rules/configuration into "virtualhost" section of main configuration that is usually in /etc/... ?

    i have just now asked this about main wordpress htacces that is for permalinks: http://wordpress.org/support/topic/how-to-write-configuration-of-htaccess-to-virtual-host-section-in-main-config?replies=1 :

    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.

    same words are for wp-super-cache's htaccess files. and more needed because wp-super-cache is for cases when server is highly loaded and htaccess works of every request join and make important difference of performance.

  2. Donncha O Caoimh
    Member
    Plugin Author

    Posted 4 years ago #

    Look up the Apache documentation. There are plenty of examples showing how. You basically have to paste the same rules in, but surrounded with a Directory directive I think.

  3. qdinar
    Member
    Posted 3 years ago #

    and i know now a tip: RewriteEngine On should be inside of 2 directory tags ie inside directory section.
    i have moved multisite wordpress rules into vhost config 1 week ago.
    i have moved just now also wp-super-cache htaccess rules into vhost config, i have tested just now, it works ( except known bug cases... ) :

    <VirtualHost *:80>
    	ServerName wp.localhost
    	ServerAlias *.wp.localhost
    	ServerAlias ..............
    	DocumentRoot /var/www/localhost/test/wpmu/
    
    	ErrorLog ...
    	LogLevel ...
    	CustomLog ...
    
    	SuexecUserGroup ...
    	Options +ExecCGI
    	AddHandler fcgid-script .php
    	FCGIWrapper ... .php
    
    	<directory /var/www/localhost/test/wpmu/ >
    		RewriteEngine On
    		AllowOverride None
    
    		# BEGIN WPSuperCache
    		<IfModule mod_rewrite.c>
    		AddDefaultCharset UTF-8
    		...
    		RewriteRule ^(.*) "/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html" [L]
    		</IfModule>
    		# END WPSuperCache
    
    		# BEGIN WordPress
    		RewriteRule ^index\.php$ - [L]
    		...
    		RewriteRule . index.php [L]
    		# END WordPress
    	</directory>
    
    	<directory /var/www/localhost/test/wpmu/wp-content/cache/ >
    		RewriteEngine On
    		AllowOverride None
    
    		# BEGIN supercache
    		<IfModule mod_mime.c>
    		...
    		</IfModule>
    
    		# END supercache
    
    	</directory>
    
    </VirtualHost>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic