开发者

redirect parked domain to another domain subfolder showing correct urls

开发者 https://www.devze.com 2023-03-23 15:40 出处:网络
i have 2 domains: - domain1.org - domain2.org i have installed wordpress in http://domain1.org/wordpress and i need that users enter with http://domain2.org

i have 2 domains: - domain1.org - domain2.org

i have installed wordpress in http://domain1.org/wordpress and i need that users enter with http://domain2.org

Currently my htaccess is(based on other posts readed here):

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} ^(www.)?domain2\.org$ 开发者_开发百科[NC]
RewriteRule ^(.*)$ http://www.domain1.org/wordpress/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]
</IfModule>

this works but always show in the links the domain1 url:

http://domain1.org/wordpress/category/furniture/

and in the browser bar i have http://www.domain2.org

Is the htaccess wrong? i have domain2 with godaddy and i'm doing a masked forward.Maybe i should park it?

thk.


# BEGIN WordPress
<IfModule mod_rewrite.c>   
# tell mod_rewrite to activate and give base for relative paths

RewriteEngine on

RewriteBase /

RewriteCond %{HTTP_HOST} ^(www.)?PARKED.com$
RewriteCond %{REQUEST_URI} !^/PARKED/ 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ /PARKED/$1 

RewriteCond %{HTTP_HOST} ^(www.)?PARKED.com$
RewriteRule ^(/)?$ PARKED/index.php [L]

# for main domain

RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]

</IfModule>

# END WordPress
0

精彩评论

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