1

I'm not very advanced at programming and I need to make a 301 redirection from one specific subdomain page to another. The tricky part, at least for me, is that the pages are on two different subdomains. So far I've only managed to 301 ALL pages to the target or crashing the whole site.

I've used many, but are currently at:

RewriteCond %{HTTP_HOST} !^spiele.deutschedownloads.de/?DriverScanner/Diverse//download/4770$ [NC]
RewriteRule ^(.*)$ http://programme.deutschedownloads.de/?DriverScanner/Drivers/Werkzeuge-Diverse/download/4413 [L,R=301]

What I want to do is simply to 301 redirect

spiele.deutschedownloads.de/?DriverScanner/Diverse//download/4770

To

http://programme.deutschedownloads.de/?DriverScanner/Drivers/Werkzeuge-Diverse/download/4413

Any help is most appreciated!

4

1 回答 1

0

这应该有效:

RewriteCond %{HTTP_HOST} ^spiele\.deutschedownloads\.de$ [NC]
RewriteCond %{QUERY_STRING} ^DriverScanner/Diverse//?download/4770/?$ [NC]
RewriteRule ^ http://programme.deutschedownloads.de/?DriverScanner/Drivers/Werkzeuge-Diverse/download/4413 [R=301,L]

如果它们都位于同一根文件夹中,则第一个条件与域匹配。

第二个条件匹配查询字符串。

如果两个条件都正常,它会重定向。

于 2013-09-24T05:30:27.090 回答