开发者

replace host in htaccess

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开发者_Go百科 same.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜