For a customer I'm implementing a new layout included with CMSMS. He has one hosted domain www.domain1.nl and 7 forwarded domains. In the current situation , if you go to www.domain2.com you get forwarded to the content of domain1 but the URL remains domain2.com.
I want to write a htaccess file which changes all of the 7 forward-domains to the main-hosted-domain.
I've started with the htaccess file, but I also want 'www' in front of it, no mather what URL you choise.. (domain3.com, www.domain3.com http://domain4.com http://www.domain5.com, the all should redirect to www.domain1.com)
Code: Select all
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
# Link to http://website.com then redirect to http://www.website.com
RewriteCond %{HTTP_HOST} ^domain1\.nl [NC]
RewriteRule ^(.*)$ http://www.domain1.nl/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^domain2\.nl [NC]
RewriteRule ^(.*)$ http://www.domain1.nl/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^domain3\.nl [NC]
RewriteRule ^(.*)$ http://www.domain1.nl/$1 [L,R=301]
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
# except for form POSTS
# RewriteCond %{REQUEST_URI} !/$
# RewriteCond %{REQUEST_URI} !\.
# RewriteCond %{REQUEST_METHOD} !POST$
# RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+).html$ index.php?pagina=$1 [QSA]
And I can't get the other URL's to work as well..