views:

31

answers:

1

Hello!

I am creating a website which is located in /shop/ on my webserver. It has a seperate domain.

Now, I want to change every request that comes in.

http://techinf.de/shop/ shall become http://holzwerkstatt-osel.de/ and http://www.techinf.de/shop/ shall become http://www.holzwerkstatt-osel.de/

the actual request, like product.php?id=2 must be the same.

+2  A: 

Since you want to persist the www (or lackthereof), you likely do need to use mod_rewrite for this. The following should work:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?technif\.de$
RewriteRule ^shop/(.*)$ http://%1holzwerkstatt-osel.de/$1 [R=301,L]

Edit: If you don't care about the whole www thing, just using mod_alias on technif.de should work:

Redirect permanent /shop http://holzwerkstatt-osel.de

This takes everything after /shop and appends it to the redirection URL, then redirects. So /shop/product.php?id=2 becomes http://holzwerkstatt-osel.de/product.php?id=2, etc.

Tim Stone
actually i dont care if there is redirection to holzwerkstatt with or without www
Acron
@pr0wl - Ah, OK, updated now with an alternative.
Tim Stone
@tim: thank you so much
Acron