Results 1 to 7 of 7
  1. #1

    Question mod_rewrite question

    I'm switching servers and changing names all at the same time.

    I want to use a mod_rewrite to seemlessly transfer my visitors to the new site as well as help keep some of my PR and Links.

    Anyways, I set up an .htaccess file as:
    RewriteEngine On

    RewriteRule ^(.*)$ http://www.newserver/$1 [R=301,L]

    But there is a problem! My old server used a public folder of /HTML and my new server uses /public_html

    Is there a conditional that I can throw into my .htaccess file to switch folders AND Redirect?


  2. #2
    Join Date
    Oct 2003
    What's wrong with a simple: redirect / in the .htaccess file?

    The public folder really doesn't matter to your visitors. They can only see what's in the public_html folder.

  3. #3
    Redirects don't work for your whole site.

    mod_rewrite allows you to redirect your whole site and also allows Spiders to follow links better.

    Example: will automatically go to


  4. #4
    Join Date
    Sep 2000
    Alberta, Canada
    kb9tyc, is giving some good advice. The only thing I would do different is:

    Redirect Permanent /

    Dont' know where you got the idea that Redirect does not work for a whole site? There is also the fact that a RewriteRule is backwards compatiable (URL doesn't change on the redirection) and SEs will not update their listings. With the Redirect they will. - for all your Hosting needs
    Helping people Host, Create and Maintain their Web Site
    ServerAdmin Services also available

  5. #5
    Unless I've missunderstood here is the difference:

    The redirect will forward the whole site but only to one page.
    So - will be forwarded to

    The mod_rewrite will forward individual pages to the new sites corresponding page.
    So - will be forwarded to

    I got my info by the way from:

    If I'm not understanding this correctly please let me know.


  6. #6
    Join Date
    Oct 2003
    The redirect should work with any page in the site. I have done this many times.

  7. #7
    OK, I'll test it out. I guess the info I got was wrong

  8. Newsletters

    Subscribe Now & Get The WHT Quick Start Guide!

Posting Permissions

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