More .htaccess Codes for Additional Domains
Published by bigBert on Tagged .htaccess, Domains, PowWeb Hosting, Web Hosting Blog, Web Hosting GuidesBrowsing thru PowWeb forum really teaches me a lot. I’ve discovered that there are different htaccess codes for redirecting multiple domain names. Aside from the one I’ve posted long time ago, here are more complex sample codes posted on the forum that will surely work with any PowWeb website:
Sample 1:
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} ^domain_name\.?tld [NC,OR]
RewriteCond %{HTTP_HOST} ^www.domain_name\.?tld [NC]
RewriteCond %{REQUEST_URI} !/subfolder/
RewriteRule ^(.*)$ subfolder/$1 [L]
Sample 2:
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond s%{HTTPS} ^((s)on|s.*)$ [NC]
RewriteRule ^/*(.+/)?([^.]*[^/])$ http%2://%{HTTP_HOST}/$1$2/ [L,R=301]
RewriteCond %{HTTP_HOST} ^domain_name\.?tld [NC,OR]
RewriteCond %{HTTP_HOST} ^www.domain_name\.?tld [NC]
RewriteCond %{REQUEST_URI} !/subfolder/
RewriteRule ^(.*)$ subfolder/$1 [L]
Sample 3:
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteRule ^([^\.]+[^/])$ http://%{HTTP_HOST}/$1/ [R=301,L]
RewriteCond %{HTTP_HOST} ^(www\.)?domain_name\.tld$
RewriteCond %{REQUEST_URI} !^/subfolder/
RewriteRule ^(.*)$ subfolder/$1 [L]
These codes seems to be confusing to me, although it resembles the one that I previously use. Aside from this, PowWeb users can also use the Map to Subdirectory Tool for creating multiple websites on the PowWeb server.
Related Articles
Adding A Second Website Using .htaccess
Adding A Second Website Using PowWeb’s ‘Map to Subdirectory Tool’
Useful Links
The PowWeb Home Page
PowWeb Forum Links
.htaccess code examples for an add’l domain
Installing a second domain


Leave a Comment
You must be logged in to post a comment.