开发者

Using .htaccess to redirect a domain to another URL

I have a site running wordpress, it's the full site. One of the pages is like a contact-us form开发者_运维问答 located at www.ourdomain.com/contact-us/

I also have a URL like contactourdomain.com and I want it to redirect to www.ourdomain.com/contact-us/

We used to do this with a redirect on network solutions, but I prefer to have it all done right on the server if possible. I've got it sort of working but when you visit the link is still says contactourdomain.com/contact-us/ as the URL, and that breaks all the other ones.

Any suggestions?


.htaccess

Options -MultiViews
RewriteEngine on
RewriteBase /

# Rewrite
RewriteRule ^(.*)$ http://www.ourdomain.com/contact-us//$1 [L]


if you add this in .htaccess is it working?:

RewriteRule ^$ contact-us/ [R=301,L]

keep me posted..

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜