开发者

Redirect folder on parked domain to main domain

开发者 https://www.devze.com 2023-02-09 09:31 出处:网络
I am moving a client\'s site from static HTMl to a WordPress site. This has also involved setting up a new domain. I have the legacy domain set up as a parked domain on my server and can successfully

I am moving a client's site from static HTMl to a WordPress site. This has also involved setting up a new domain. I have the legacy domain set up as a parked domain on my server and can successfully redirect all requests for the parked domain to the main domain. Here is my .htaccess in full:

# Use PHP5 Single php.ini as default
AddHandler application/x-httpd-php5s .php

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

# Rewrite from parked domain to new domain
RewriteCond %{HTTP_HOST} ^parked-domain.co.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www.parked-domain.co.uk$
RewriteRule ^/?$ "http\:\/\/www\.main-domain\.co\.uk" [R=301,L]

# All requests hit www.domain.co.uk to prevent duplicate content
RewriteCond %{HTTP_HOST} !^www.main-domain.co.uk$ [NC]
RewriteRule ^(.*)$ http://www.main-domain.co.uk$1 [L,R=301]

However, I am coming unstuck when I try to redirect requests for specific pages on the parked domain to pag开发者_StackOverflow社区es at the main domain.

For example, requests for parked-domain.co.uk/html/about_us.html should redirect to main-domain.co.uk/about-us/

I've a hit a brick wall (in spite of many hours of forum-searching) and any help would be gratefully received; this is rage-inducing.


What happens when you simply add

Redirect/html/about_us.html http://www.main-domain.co.uk/about_us.html

to that file?

0

精彩评论

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