How to edit virtualhost file?
I have these instructions from here - Removed - for the virtual hosts of a specific site but I am not sure where and how to make the edit. I have used for the time being htaccess but I understand that it is better if it is in the vhosts file.
This configuration is meant to go the same block as whatever VirtualHost or other directive you have your wiki's DocumentRoot, ServerName, etc... already defined in.
To add this config:
RewriteEngine On
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/index.php [L]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^/?images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/thumb.php?f=$1&width=$2 [L,QSA,B]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^/?images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B]-
I have used for the time being htaccess but I understand that it is better if it is in the vhosts file.
That code is belongs in your htaccess file, IMO.0 -
Right, I thought that by being in vhosts it means that the the system does not have to read every directory for an htaccess files, hence being more effective. 0 -
I do agree with @Infopro this would be best added to your .htaccess but if you want to add it to the VirtualHost conf you can do so through WHM>>Service Configuration>>Apache Configuration >> Include Editor You can read the include editor documentation here: Include Editor - Version 76 Documentation - cPanel Documentation Thanks! 0
Please sign in to leave a comment.
Comments
3 comments