www.domain.com to www.otherdomain.com

Discuss practical ways rearrange URLs using mod_rewrite.

www.domain.com to www.otherdomain.com

Postby Guest » Sat Nov 13, 2004 8:57 am

I think it´s a very simple request, but I can´t manage. To use google-Adsense and a few other scripts I have to use only one domain. When the user types
repor.de/dc/kultur.php
repor.de/dc/kultur.php
rechercheportal.de/dc/kultur.php

he shall see in the adressbar
www.rechercheportal.de/dc/kultur.php

I tried the following Code - but it didn´t work.

RewriteCond %{HTTP_HOST} ^rechercheportal\.de$
RewriteRule ^(.*)$ http://www.rechercheportal.de/$1 [R=301,L]

Can anyone help me?

Thank you.

David
Heidelberg, Germany
Guest
 

Postby Caterham » Tue Feb 15, 2005 7:17 am

.htaccess file - must accessible for all domains wrote:
Code: Select all
RewriteEngine On
RewriteCond %{HTTP_HOST} ^rechercheportal\.de [NC,OR]
RewriteCond %{HTTP_HOST} ^(www\.)?repor\.de$
RewriteRule ^(.*)$ http://www.rechercheportal.de/$1 [R=301,L]
check also, if mod_rewrite is available and working
Caterham
 
Posts: 690
Joined: Fri Dec 10, 2004 1:30 pm


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 46 guests

cron