开发者

Using .htaccess to redirect a domain to another URL

开发者 https://www.devze.com 2023-04-10 09:26 出处:网络
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 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

精彩评论

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