301 redirect

Ledlys

Regular Member
Joined
Oct 3, 2011
Messages
232
Reaction score
0
I'm looking to 301 redirect some of my pages to my main page using htaccess file.
Today I have a redirect code without rewrite rule. Whats the different? I'm want the best seo way which I believe that is all pages of the other domain going to my money main domain, e.g http://www.hats.com/blackhats goes to http://www.hats.se

Can anyone copy and past the code you're using?

thanks!
 
today I use this code:

Options +FollowSymLinks

RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

and now my http://www.domain.com/something redirects to http://www.domain.no/something. But I want all this /something to redirect directly to the new domains
[FONT=Verdana, Arial]landing page. Any suggestions?[/FONT]
 
You can simple use a plugin if you are using wordpress and also if you have cpanel hosting there is any url-redirection option your cpanel.
 
Thanks, but I used to have a htaccess code doing this. Then my host created this redirect like you said, but then i creates http://www.hats.com/whatever to http://www.hats.net/whatever, and I do not have any hats.net/whatever making people going to a place that do not exist.

Anyone have any htaccess code like this?
 
anyone done this before?
 
if you just want your visitor to land on the page, you could edit your 404.php and redirect that to your money page :)
 
Got it, now I use this:


Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.mydomain/ [R=301,L]
 
Got it, now I use this:


Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.mydomain/ [R=301,L]

Ledlys,

If the code you have is working fine for you that's great but you should really have a directive in there stating a condition in order for the redirect to happen. The proper way to write a redirect to another domain would be as follows,
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.example.com$
RewriteRule ^(.*)$ http://www.newexample.com/$1 [R=301,L]

Note that you would only have the "L" in the brackets if it's the last rule.

Best,

Shawn
 
I'm about to do this. domain.com/page1 to newsomain.com. I just did it on plugins, don't know how on httacess.
 
Back
Top