Get exclusive CAP network offers from top brands

View CAP Offers

How to set a re-direct for all sub-pages?

livegirl1 asked 3 years ago
Hi there,

I have just started re-designing my website and since I don’t know php (yet) and don’t use the CMS system, most of my work is done manually. That is fine and enough for the purpose of my sites for now (news will be added via built-in blog) but I have a problem with changing the names of my sub-pages.

I hear that I should use a re-direct 301 but tbh I have never done it so can someone advise if that’s what I need here?

Basically, I’m changing sites from, eg. http://www.mysite.com/i-like-you.html to http://www.mysite.com/ilikeyou.html
So should I keep the other site on server and just re-write it with re-direct script? Or should I create that htaccess file and it will re-direct all invalid subpages to the main page for me? (I would like that!)

Hope you can help! Thanks :hattip::hattip:

11 Answers
GaryTheScubaGuy answered 3 years ago
Hi Livegirl,

You will want to use a htaccess to accomplish this rather than a redirect because you are (seemingly) redirecting the entire site starting with what I am guessing is your primary subdirectory.

You could use 301’s, but you would want need to do it on each page.

Also be sure to use the canonicalisation feature to assign one primary domain to preserve link juice. You can read more about that here; Canonicalisation

Why is it that you are doing this anyways? The removal of the dashes will not provide any added SEO element to the URL structure?

Gary

livegirl1 answered 3 years ago
Hi Gary,

Thanks for replying!

It’s not the whole site, it’s some sub-directories. The dashes were just an example – I want to change the title of sub-pages from for example main.html to livedealers.html etc.

Will htaccess also handle the wrong spelling of my sites? Or any old sub-pages that I might have changed in the past?

Thanks,
livegirl <span title=” title=”” class=”bbcode_smiley” />

GaryTheScubaGuy answered 3 years ago
livegirl1;199109 wrote:
Hi Gary,

Thanks for replying!

It’s not the whole site, it’s some sub-directories. The dashes were just an example – I want to change the title of sub-pages from for example main.html to livedealers.html etc.

Will htaccess also handle the wrong spelling of my sites? Or any old sub-pages that I might have changed in the past?

Thanks,
livegirl <span title=” title=”” class=”bbcode_smiley” />

Hi Livegirl1,

The .htaccess file is a text file which resides in your main site directory and/or in any subdirectory of your main directory. There can be just one, there can be a separate one in each directory or you may find or create one just in a specific directory.

Any commands in a .htaccess file will affect both the directory it is in and any subdirectories of that directory. Thus if you have just one, in your main directory, it will affect your whole site. If you place one in a subdirectory it will affect all the contents of that directory.

You could use a redirect meta tag in the head of the old pages to bring users to the new ones, but some search engines may not follow the redirect and others frown upon it.

Here’s how to do it;

Enter this line in your .htaccess file:
Redirect permanent /oldfile.html http://www.domain.com/filename.html

You can repeat that line for each file you need to redirect. Remember to include the directory name if the file is in a directory other than the root directory:
Redirect permanent /olddirectory/oldfile.html http://www.domain.com/newdirectory/newfile.html

(this is wrapping here but needs to be on a single line)

If you have just renamed a directory you can use just the directory name:
Redirect permanent /olddirectory http://www.domain.com/newdirectory

If you have backlinks to your site this will also fix this issue, and any future issues.

Yes and yes to your last 2 questions,

livegirl1 answered 3 years ago
thank you ever so much Gary x

GaryTheScubaGuy answered 3 years ago
Geez livegirl1, I just noticed your in Hawaii.

Want some free SEO??

Put me there for 2 weeks and I;ll have you top 3 before you give me the return flight tickets!

Gary

faststeady answered 3 years ago
garytsg

just read your blog after discovering it through this thread.

had to post that i was fascinated. first time i’ve read about seo thats not written in such an esoteric way it all becomes to hard.

cheers

GaryTheScubaGuy answered 3 years ago
faststeady;199288 wrote:
garytsg

just read your blog after discovering it through this thread.

had to post that i was fascinated. first time i’ve read about seo thats not written in such an esoteric way it all becomes to hard.

cheers

Thanks faststeady,

I try to keep things in laymans terms as much as possible but sometimes that’s the real challenge. Were you referring to ppc-managers.blogspot.com or garythescubaguy.com?

Thanks again. That makes it worth continuing to do. Cheers!

faststeady answered 3 years ago
your names sakes blog, ill read the other one tonight.

will be definately giving you a hollow in the near future if you dont mind when kundans finished my latest project design to ensure i plan it out properly at the start <span title=” title=”” class=”bbcode_smiley” />

cheers

livegirl1 answered 3 years ago
GaryTheScubaGuy;199258 wrote:
Geez livegirl1, I just noticed your in Hawaii.

Want some free SEO??

Put me there for 2 weeks and I;ll have you top 3 before you give me the return flight tickets!

Gary

hahaha ok!

where do i have to fly you from? <span title=” title=”” class=”bbcode_smiley” />

GaryTheScubaGuy answered 3 years ago
London <span title=” title=”” class=”bbcode_smiley” />

I’ll be in Cancun and Holland for the next 6 weeks though for CAP Spring Break and CAP/A4U & the CAC conferences. June my son and sister are flying in so May is really the only thing open and I’m in Sweden the last week so anytime between the 1-3rd week of May. :highflyer