###### # # Note: You can use http://check-these.info/tools/genht_php.txt # to setup this code, automatically. # # 1. For sub.domain.com, create a directory sub.domain.com # under the main /htdocs, using WebFTP, sitemanager or other tools. # # /www/U/USER/htdocs/ <== main /htdocs # /www/U/USER/htdocs/sub.domain.com/ <== directory for sub.domain.com # # /www/U/USER/htdocs/2nd-domain.com/ <== directory for 2nd-domain.com # /www/U/USER/htdocs/sub.2nd-domain.com/ <== directory for sub.2nd-domain.com # # 2. To use virtual document root feature, put following script into # main /htdocs as "virtauldr.cgi" and set permission to 700. # http://check-these.info/tools/virtauldr_cgi.txt # # 3. Copy & Paste this code into the .htaccess of main /htdocs, # Using WebFTP or other tools. # /www/U/USER/htdocs/.htaccess # # And edit the line for skipping main domain, bellow. # You need to know the name of main domain, and main username. # These can be found in OPS -> Packages -> HTTP # # IMPORTANT: Please be aware that making mistake in the .htaccess # may cause general 500 internal server error. # Use WebFTP to edit again. # # Uploading .htaccess in wrong FTP transfer mode will cause # General 500 error, too. Use WebFTP to edit, # as It will save the file in correct line ending (LF). # # Please check following page for more detail/update: # http://check-these.info/hosting/Generic_htaccessMethod.html # RewriteEngine on RewriteBase / # Virtual document root loop stopper and rewrite code for CGI/PHP # Remove these 2 lines if you don't use this feature. # You must have /www/U/USER/htdocs/virtualdr.cgi with chomd 700 # for this feature to work. RewriteRule ^/*virtualdr.cgi - [L] RewriteRule ^/*[^./]+\.[^/]+/.*\.(cgi|php5?)$ virtualdr.cgi [L] # Loop stopper code RewriteRule ^/*[^./]+\.[^/]+/.*$ - [L] # Code for missing Trailing slashe problem # (to avoid double login or missing www) # RewriteCond s%{HTTPS} ^((s)on|s.*)$ RewriteRule ^/*(.+/)?([^.]*[^/])$ http%2://%{HTTP_HOST}/$1$2/ [L,R=301] ######## # Put most other RewriteRules that applies to all domains, here. # (Force www, Remove www, Bad browser kick out, Anti-leech, ...) ######## # Skip processing sub/pointed domain rules for; # MAINDOMAIN.COM, MAINDOMAINCOM.secure.powweb,com # USER.secure.powweb.com, or USER.temp.powweb.com. # # Edit 'MAINDOMAIN', 'COM', and 'USER' to fit your account. # DO NOT modify anything else, unless you know what you are doing. # You can find main domain name and USER name in OPS -> Packages -> HTTP # # example: RewriteCond %{HTTP_HOST} !^(www\.)?(yoursite\.?com|username) [NC] # # If you want your main domain to be redirected to # /www/U/USER/htdocs/MAINDOMAIN.COM, like other sub/pointed domains. # comment out by adding # or remove this line # RewriteCond %{HTTP_HOST} !^(www\.)?(MAINDOMAIN\.?COM|USER) [NC] # Sub/pointer domain rewrite code, main body RewriteCond %{HTTP_HOST} ^(www\.)?(.*)$ [NC] RewriteRule ^(.*)$ %2/$1 ######## # Put other RewriteRules that need prioror sub/pointed domain rewrite, here. ########