cancel
Showing results for 
Search instead for 
Did you mean: 

.htaccess for 301 redirect

aj182z
Newbie
Posts: 6
Registered: ‎20-08-2009

.htaccess for 301 redirect

Hi I need your help please...OK, so basically what I'm looking to do is as follows
Due to some web hosting issues (which I won't go into) my website has been wrongly indexed by the search engines as www.username.plus.com and I would like it to be www.mynewdomainname.com and not the local plusnet account domain name...also I want to set it up so that if you type in the plusnet URL it will redirect to my domain name too.
I was told I can use a .htaccess file to do this, but I don't have a clue about .htaccess files so any help you can give me will be appreciated :-)
3 REPLIES
csogilvie
Grafter
Posts: 5,852
Registered: ‎04-04-2007

Re: .htaccess for 301 redirect

Information about .htaccess files on Plusnet Webspace can be found on the .htaccess tutorial.
You should be able to do something to help redirect it to a different place as well, but you'll need to be careful as both the username.plus.com and the mynewdomainname.com will read the same .htaccess file.
aj182z
Newbie
Posts: 6
Registered: ‎20-08-2009

Re: .htaccess for 301 redirect

thanks but the tutorial does not contain the information I need.
I have tried the following
.htaccess file in the htdocs directory containing...
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
The pages then error with, "Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@plus.net and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log."
I contacted Plusnet support who replied as follows...
Unfortunatly we are unable to provide direct support on this.
The login behind it would be a .htaccess file in the htdocs directory.
This should first check to see if the visitor is looking at www.username.plus.com. It should ignore other requests.
mod_rewrite can then perform a 302 redirect.
The first line can be done with RewriteCond rule, the  second with a RewriteRule.
The forums may be able to offer more specific support.
aj182z
Newbie
Posts: 6
Registered: ‎20-08-2009

Re: .htaccess for 301 redirect

This is the solution thanks to CSO on another post http://community.plus.net/forum/index.php/topic,78811.0.html
RewriteEngine On
RewriteCond %{HTTP_HOST}  ^www.username.plus.com$
RewriteRule (.*) http://www.domain.com/$1 [R=301,L]