Portal Home > Knowledgebase > Articles Database > Use one domain for a certain page, another domain for all the other pages


Use one domain for a certain page, another domain for all the other pages




Posted by mikk999, 07-01-2010, 12:56 PM
i will use short domains becuase the real ones are long and i don't want this forum coming up in search results for the domain. This is what I already have: hjk.com and abc.com are domains for the same site abc.com/* redirected to www.abc.com/* hjk.com/* redirected to www.hjk.com/* www.abc.com/index.php rewritten to www.abc.com www.abc.com/index.php?x=y rewritten to www.abc.com/hello www.hjk.com redirected to www.hjk.com/index.php?x=y www.hjk.com/index.php?x=y rewritten to www.hjk.com/hello Those parts work. I want www.hjk.com/* that is not www.hjk.com/index.php?x=y to go to www.abc.com/* I've tried and tried but can't get the last part to work. Please help.

Posted by ExoHosting-UK, 07-01-2010, 02:21 PM
You could use some HTAccess rewrite rule for this I guess, but you'd have to google it, as i'm not an expert at Htaccess redirects..

Posted by mikk999, 07-01-2010, 02:30 PM
yes, at the moment i'm using htaccess to do the things above. I just need to work out the rule(s) so that if www.hjk.com/* and not (www.hjk.com/index.php?x=y or www.hjk.com/hello) then go to www.abc.com/*

Posted by ExoHosting-UK, 07-01-2010, 02:48 PM
Maybe some sort of condition that redirects to index.php or something? Saying that i'm not totally sure that'd work. Sorry, as I said i'm not great with anything to do with htaccess except password protection and custom error documents :-) I'll have a think for you Best of luck, Ben.

Posted by Steve_Arm, 07-01-2010, 03:39 PM
Hmm... RewriteCond %{HTTP_HOST} ^http://www.hjk.com/?$ RewriteCond %{REQUEST_URI} !/?index.php RewriteRule ^(.*)$ http://www.abc.com/$1 [L,QSA] ?

Posted by mikk999, 07-02-2010, 12:42 AM
Nope, that just makes an infinite loop.

Posted by Steve_Arm, 07-02-2010, 08:37 AM
That's what I though. I think the way you have it now the loop is inevitable.

Posted by Website themes, 07-02-2010, 09:59 AM
Just setup hjk.com to a different document root than abc.com and then put the following in hjk.com's .htaccess file: rewriteengine on redirectpermanent / http://www.abc.com



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
IIS FTP (Views: 459)
Datahosts.net (Views: 475)