+ Post New Thread
Results 1 to 6 of 6
Web Development Thread, Redirects .. but without the same page name .. in Coding and Web Development; Right, ok, I have googled and tried different things but here's the story... I've just redone our school website (done ...
  1. #1
    soveryapt's Avatar
    Join Date
    Jan 2009
    Location
    Lancashire
    Posts
    2,402
    Thank Post
    648
    Thanked 277 Times in 244 Posts
    Rep Power
    78

    Redirects .. but without the same page name ..

    Right, ok, I have googled and tried different things but here's the story...

    I've just redone our school website (done an inbetween solution as they want to bring Moodle on stream properly sometime soon so it's more a static site than anything else) ..

    Anyway, the old site was stored in /2 and I've moved the new site to the root so what I want to do is redirect all the:

    Accrington St Mary Magdalen's CE Primary School

    traffic to:

    http://www.accringtonstmarymagdalens.co.uk/

    Now, using the standard:

    Code:
    Redirect 301 /2 http://www.accringtonstmarymagdalens.co.uk/
    Is great, only that is maps the old page name (for instance St Mary Magdalen's Primary School) to the new location (http://www.accringtonstmarymagdalens.co.uk/main.shtml) when that page doesn't exist in the new location.

    I think I'm writing in looking to do some sort of rewrite, but I'm out of practice with .htaccess files and the things I'm trying don't seem to be working, so, any suggestions?

    Ta
    Andy

  2. #2

    tmcd35's Avatar
    Join Date
    Jul 2005
    Location
    Norfolk
    Posts
    5,665
    Thank Post
    850
    Thanked 893 Times in 738 Posts
    Blog Entries
    9
    Rep Power
    328
    I've always used a HTML meta tag in the header. Works for me...

    HTML tips: Redirect to a new page

  3. #3
    soveryapt's Avatar
    Join Date
    Jan 2009
    Location
    Lancashire
    Posts
    2,402
    Thank Post
    648
    Thanked 277 Times in 244 Posts
    Rep Power
    78
    Quote Originally Posted by tmcd35 View Post
    I've always used a HTML meta tag in the header. Works for me...

    HTML tips: Redirect to a new page
    Yeah, problem there is going through the hundreds of pages for the old site (really, you should see it, no page calling of uniform variables on the site, just hundreds of pages of bleurgh) ..

    Plus, HTML Meta Tags are great if you have no other option, but .htaccess redirects are more secure and better for page rankings on search engines and all that jazz ..

  4. #4

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,406
    Thank Post
    639
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    324
    Something like this should work if you're using mod_rewrite.

    Code:
    RewriteBase /2/
    RewriteRule ^(.*)$ http://www.accringtonstmarymagdalens.co.uk/ [R=permanent,L]

  5. #5
    soveryapt's Avatar
    Join Date
    Jan 2009
    Location
    Lancashire
    Posts
    2,402
    Thank Post
    648
    Thanked 277 Times in 244 Posts
    Rep Power
    78
    Quote Originally Posted by webman View Post
    Something like this should work if you're using mod_rewrite.

    Code:
    RewriteBase /2/
    RewriteRule ^(.*)$ http://www.accringtonstmarymagdalens.co.uk/ [R=permanent,L]
    Ta, just tried that but get this :

    Quote Originally Posted by FireFox Browser
    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.

    * This problem can sometimes be caused by disabling or refusing to accept cookies.
    It's similar to what I tried before but I just got //main.shtml previously ..

  6. #6
    soveryapt's Avatar
    Join Date
    Jan 2009
    Location
    Lancashire
    Posts
    2,402
    Thank Post
    648
    Thanked 277 Times in 244 Posts
    Rep Power
    78
    Sussed it (thanks to Beyond Redirect: Using ReWriteRule in .htaccess) ..

    Code:
    Options +FollowSymlinks
    RewriteEngine on
    RewriteOptions MaxRedirects=10
    
    RewriteRule ^2/(.+)$ http://www.accringtonstmarymagdalens.co.uk [R=301,NC]
    Now to get the thing to redirect a non www. site to a www. site without getting the result of http://www.accringtonstmarymagdalens...agdalens.co.uk .. lol ..


SHARE:
+ Post New Thread

Similar Threads

  1. [MS Office - 2007] Word - Prints second page over first page in two page mode!?!
    By reggiep in forum Office Software
    Replies: 2
    Last Post: 2nd November 2009, 12:37 PM
  2. No Page Titles
    By Zorba in forum EduGeek Joomla 1.5 Package
    Replies: 6
    Last Post: 3rd May 2009, 11:51 AM
  3. [CLOSED] Bug/Error: Homepage redirects to unavalible page when log in in cached
    By SYNACK in forum EduGeek.net Site Problems
    Replies: 5
    Last Post: 20th March 2008, 05:24 AM
  4. What do you have as your home page...
    By _Bat_ in forum General Chat
    Replies: 23
    Last Post: 10th January 2007, 10:34 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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