SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: Redirect Links

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Aug 2000
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is probably a really stupid question, but I am in the midst of redesigning my site and am renaming from shtml to php3, the search engines have my pages as shtml (actually they still have some html) how do I keep visitors from hitting the 404 page everytime they click on a link from the search engine? I have ALOT of pages, making a META redirect for each page seems a daunting task, is there an easier way?

  2. #2
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    If you know PHP you can easily build a page that to replace your 404 error. What this page would do is remove the extension, add .php3 and redirect the user to that page. If the page has a php3 extension and its still not found you can display a 404 error similar to Sitepoint.com's
    ( www.sitepoint.com/missingpage.html ).

    This would take a knowledge of PHP though, which I currently lack at this time.

    Logic would be:
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
    if extension not equal to php3
    find '.' in URL string.
    remove everything to the right of the '.'
    concatenate 'php3'
    redirect user
    else
    display 404 error message with feedback form.
    [/code]

    ------------------
    Wayne Luke - Sitepoint Forums Administrator
    Digital Magician Magazine - MetaQuark Creations (Coming Soon)
    wayne@sitepoint.com

  3. #3
    SitePoint Member
    Join Date
    Aug 2000
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sounds good to me, I guess I am off to track down some more PHP tuts. I am just starting to learn PHP and can't do much more than put an include in. :-)
    Thanks for the input!

  4. #4
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    There is a very good book from Wrox Publishing on PHP.. You can read the review here: http://www.webmasterbase.com/article.php3?aid=221&pid=0

    Also on WebmasterBase.com is a full tutorial on using PHP and a database to activate your website. It was written by a SitePoint staff member and is one of the best Internet Tutorials I have seen. You can see it here: http://www.webmasterbase.com/article.php3?aid=228&pid=0

    I hope this helps you with PHP.

    ------------------
    Wayne Luke - Sitepoint Forums Administrator
    Digital Magician Magazine - MetaQuark Creations (Coming Soon)
    wayne@sitepoint.com


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
  •