301 Redirect Using htaccess

Using htaccess to accomplish the 301 redirect is highly suggested due to it being fairly convenient to manage, rather than setting redirects on each individual page, you can simply add the redirect code to the .htaccess file.
Here is how to do it:
  1. Create a file on the root directory of your website, name it ".htaccess".
  2. Open the .htaccess file using notepad or what ever text editor that you prefer.
  3. Add this into the .htaccess file, save it and then upload it to your web server:
Redirect 301 /old/old.html http://www.you.com/new.html
Can someone translate this into english cause i appear to have canonisation (is that spelt right?) issues on my index page.

Or maybe the question should be is this the right way of sorting it out?
 
If you are on shared hosting most wont allow ISAPI type software to be installed on their servers unless it is already there.

Can you give an example of what you are wanting to redirect from and to? How many URLs are you needing to remap?
Dan's correct if oyu are on a shared windows server then you are stuck.

Contact your host and see if they have any form of ISAPI rewrite already set up.
 
  • Like
Reactions: PI Guy
Upvote 0
Anything regarding redirecting needs the appropriate software installed on the server. Whether that be a linux or windows server.

You need to contact your host to see if they have anything installed already.

If they haven't and you are on a shared windows server then you can't do redirects (as far as I'm aware) without your hosts installing the appropriate software. They probably won't do this as it may affect other sites on the server and they won't want to risk this (quite rightly).

Your alternatives are move hosts to a linux server as mod_rewrite will already be installed or move to a dedicated windows server and install a package like ISAPI Rewrite.
 
Upvote 0

RedEvo

Free Member
May 12, 2007
5,767
1,531
62
Aboyne, Aberdeenshire
I don't know what else you have going on in your .htaccess file. Here's a complete file....
Code:
#
#  mod_rewrite in use
#

RewriteEngine On

RewriteBase /

#RedEvo non www fix
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^salgadoinvestigations.com [NC]
RewriteRule ^(.*)$ http://www.salgadoinvestigations.com/$1 [L,R=301]
d
 
Upvote 0
I have this on the page but it doesn't work. I must be doing something wrong. let me add that the 1st bit works ie redirecting the non-www to the www

#
# mod_rewrite in use
#

RewriteEngine On

RewriteBase /

#RedEvo non www fix
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^salgadoinvestigations.com [NC]
RewriteRule ^(.*)$ http://www.salgadoinvestigations.com/$1 [L,R=301]

Redirect 301 /salgadoinvestigations.com/process-servers.html http://www.salgadoinvestigations.com/process-server.html

Redirect 301 /salgadoinvestigations.com/process-services.html http://www.salgadoinvestigations.com/process-server.html
 
Upvote 0

RedEvo

Free Member
May 12, 2007
5,767
1,531
62
Aboyne, Aberdeenshire
I have this on the page but it doesn't work. I must be doing something wrong. let me add that the 1st bit works ie redirecting the non-www to the www

Yes - read my post. You can't use yourdomain.com to describe the page you are redirecting from. The format should be as I described. I see the non www to www is working so this tells me your server is all OK.

I'd also look at your Home menu item as this no longer works.

d
 
  • Like
Reactions: PI Guy
Upvote 0

RedEvo

Free Member
May 12, 2007
5,767
1,531
62
Aboyne, Aberdeenshire
One last question

Can I redirect the index.html page to http://www.salgadoinvestigations.com?

Same way you redirected Index.html I guess ;)

Also, you have some 'spare' characters in your homepage title tag (Google shows 66, Yahoo 120), why not create a call to action with your phone number? This 66 chars, might be worth experimenting with it.
Code:
Private Investigator and Process Server, Call FREE on 0800 4587276
 
Upvote 0
Same way you redirected Index.html I guess ;)

Also, you have some 'spare' characters in your homepage title tag (Google shows 66, Yahoo 120), why not create a call to action with your phone number? This 66 chars, might be worth experimenting with it.
Code:
Private Investigator and Process Server, Call FREE on 0800 4587276
I tried it and it produces the following result
The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
 
Upvote 0

Latest Articles

Join UK Business Forums for free business advice