[solved] mod_rewrite parked domains

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
crankshaft
Forum Members
Forum Members
Posts: 57
Joined: Sun Mar 25, 2007 7:42 am

[solved] mod_rewrite parked domains

Post by crankshaft »

Hi all;

I have tried without success probably half a dozen times in the last few weeks, to get all of the parked domains to rewrite to the same domain uisng .htaccess mod_rewrite, but no matter what I do I am unable to get the domain rewriting to work at all.

The /parent/child rewrite works fine, no problem at all, but no matter what I do, I simply cannot rewrite the parked domains.

Any help would be really appreciated as I have spent soo much time on this, tried so many examples which were supposedly proven and guaranteed to work and made no progress at all !

Here's the .htaccess

Code: Select all

Options -Indexes +FollowSymLinks
Order allow,deny
Allow from All
RewriteEngine on

# Redirect all parked not equal to www.domain.co.uk
RewriteCond %{HTTP_HOST}   !^www\.domain\.co\.uk [NC]
RewriteCond %{HTTP_HOST}   !^$
RewriteRule ^/(.*)         http://www.domain.co.uk/$1 [L,R]

# 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 ^(.+)$ index.php?page=$1 [QSA]
Last edited by crankshaft on Thu Jun 14, 2012 12:52 am, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: mod_rewrite parked domains

Post by calguy1000 »

This is NOT a CMSMS issue.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
crankshaft
Forum Members
Forum Members
Posts: 57
Joined: Sun Mar 25, 2007 7:42 am

Re: mod_rewrite parked domains

Post by crankshaft »

Hi;

Thanks, but since config.php contains the:

$config['root_url'] parameter

I thought that it might be somehow overriding mod_rewrite, but even if it's not I would really still appreciate help as I am being penalized by google for duplicate content and really have spent a lot of time to try and resolve this myself before requesting help.

If this post should be in some other section of the forum, then please move it.

Many Thanks
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: mod_rewrite parked domains

Post by calguy1000 »

mod_rewrite rewrites INCOMING requests it has nothing to do with generating URLS in html code. That's where CMSMS comes in.

so if you're pointing numerous domains to the same directory, you should use mod_rewrite to rewrite the URLS so that a request for myotherdomain.com gets rewritten to a request for mydomain.com and then CMSMS will work justf fine. And you shouldn't have any duplicate content problems.

CMSMS core is not, and never will handle multi-domain setups. There are third party modules that may have some success in handling some parts of that problem but it is not a CMSMS issue.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
crankshaft
Forum Members
Forum Members
Posts: 57
Joined: Sun Mar 25, 2007 7:42 am

Re: mod_rewrite parked domains

Post by crankshaft »

Hi;

Yes, thanks, that's what I have done with mode_rewrite and the reason for the first post:

Code: Select all

# Redirect all parked not equal to www.domain.co.uk
RewriteCond %{HTTP_HOST}   !^www\.domain\.co\.uk [NC]
RewriteCond %{HTTP_HOST}   !^$
RewriteRule ^/(.*)         http://www.domain.co.uk/$1 [L,R]
However this is not having any effect, I have around 2 or 3 parked domains which need to be rewritten to the same one domain and are using the rules above, however this rule is having no effect whatsoever and the parked domains are unchanged in the browser's address bar.

The other parent/child rule in the same .htaccess file works just fine ?!
Locked

Return to “[locked] Installation, Setup and Upgrade”