SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Member
    Join Date
    Mar 2006
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Restructuring large site

    I have a website consisting of about 1500 static html files. I need to redevelop and restructure the whole site using PHP and MySQL. The site is well established and I will need to redirect all the old urls to the new ones in a Search Engine friendly manner. What is the best way to go about this?

    Currently the urls are of the format - http://domain.com/yada/some_page.html
    I want the new urls to be of the format - http://domain.com/yada/some-page

    I don't want to use underscores in the new urls.

    Would I be able to achieve this using mod_rewrite? Would this put a strain on the server?

    Or would I have to set up a 301 redirect file for each of the static html files?

    Any advice on the best way to go about this would be great ..

    Cheers

  2. #2
    I am obstructing justice. bronze trophy fatnewt's Avatar
    Join Date
    Jul 2002
    Location
    Ottawa, Canada
    Posts
    1,766
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by haroldo
    Would I be able to achieve this using mod_rewrite? Would this put a strain on the server?
    No. mod_rewrite would mean you're still going to use the old URLs always. If you're permenantly changing your site's structure, it's probably better to make the transition now.

    mod_rewrite Rewrites URLs... it doesn't redirect (at least, not as far as a browser, user or search engine is concerned).

    Quote Originally Posted by haroldo
    Or would I have to set up a 301 redirect file for each of the static html files?
    HTTP 301 redirects are what you want. Now, you may be able to set up a standard rule using an .htaccess file that forwards all .html pages to the folder structure you're using. You may also be able to have it swap the underscore for a hyphen. That way you'd only really need one file to do all of the redirecting for you.

    I'm not the best person to tell you exactly how.. perhaps someone with a better memory for regular expressions can provide one?
    Colin Temple [twitter: @cailean]
    Web Analyst at Napkyn


  3. #3
    Twitter: @SprightlyMedia Manpasand's Avatar
    Join Date
    Feb 2005
    Location
    Internet
    Posts
    406
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by haroldo
    Or would I have to set up a 301 redirect file for each of the static html files?
    Same thing was happend with me and I use 301 redirect using .htaccess file. Now that site is fully indexed by Google & MSN and partially by Yahoo.

    I hope Yahoo directory will help the indexing that site. :fingure crossed:

  4. #4
    SitePoint Wizard bronze trophy Kailash Badu's Avatar
    Join Date
    Nov 2005
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, 303 redirect is the way to go. If all the pages in your site follow a consistent URL scheme, then it won’t be difficult to pull off.

  5. #5
    I am obstructing justice. bronze trophy fatnewt's Avatar
    Join Date
    Jul 2002
    Location
    Ottawa, Canada
    Posts
    1,766
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Kailash Badu
    Yes, 303 redirect is the way to go.
    ... 301*

    303 is "See Other". 301 is "Moved Permenantly", which is what you want.
    Colin Temple [twitter: @cailean]
    Web Analyst at Napkyn


  6. #6
    Twitter: @SprightlyMedia Manpasand's Avatar
    Join Date
    Feb 2005
    Location
    Internet
    Posts
    406
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    perhaps typing mistake

  7. #7
    Galactic Overlord gold trophysilver trophybronze trophy
    HAWK's Avatar
    Join Date
    Aug 2003
    Location
    New Zealand
    Posts
    12,540
    Mentioned
    956 Post(s)
    Tagged
    14 Thread(s)
    A typing mistake that could have quite serious repercussions!!

  8. #8
    I am obstructing justice. bronze trophy fatnewt's Avatar
    Join Date
    Jul 2002
    Location
    Ottawa, Canada
    Posts
    1,766
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh yeah... I figured it was a typo, I just wanted it to be pointed out so nobody made the mistake in practice.
    Colin Temple [twitter: @cailean]
    Web Analyst at Napkyn


  9. #9
    SitePoint Wizard bronze trophy Kailash Badu's Avatar
    Join Date
    Nov 2005
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oops! That was a terrible mistake. I wish I had had a second look at that before posting. Thanks that you guys picked this one up. It is your quick response that makes this forum so wonderful.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •