Results 1 to 5 of 5
  1. #1

    How to move entire site except a few pages with htaccess

    I know how to move entire site using htaccess
    Code:
    Redirect 301 / http://www.example.com/
    But, how to exclude a few pages being moved?
    I have
    page1.html
    page2.html
    page3.html
    page4.html
    page5.html

    How to exluce those pages?

  2. #2
    If you redirect / to a different website in .htaccess, everything will redirect. Instead you can set a redirect in the index of your website so people accessing your website will be redirected to http://www.example.com/ but then all the websites of your website can be directly accessed using http://yourdomain.com/pagename including

    page1.html
    page2.html
    page3.html
    page4.html
    page5.html

    BTW, you can set the redirection in your index file using the following code:

    <meta http-equiv="Refresh" content="1; url=http://www.example.com/">
    | LinuxHostingSupport.net
    | Server Setup | Security | Optimization | Troubleshooting | Server Migration
    | Monthly and Task basis services.
    | MSN : madaboutlinux[at]hotmail.com | Skype : madaboutlinux

  3. #3
    Join Date
    Oct 2004
    Location
    Kerala, India
    Posts
    4,743
    Quote Originally Posted by nee4 View Post
    I know how to move entire site using htaccess
    Code:
    Redirect 301 / http://www.example.com/
    But, how to exclude a few pages being moved?
    I have
    page1.html
    page2.html
    page3.html
    page4.html
    page5.html

    How to exluce those pages?
    Use the following redirect rule
    Code:
    RewriteRule !^((page1\.html|page2\.html|page3\.html|page4\.html|page5\.html)(/.*)?)$ http://www.example.com [QSA,L]
    David | www.cliffsupport.com
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

  4. #4
    Join Date
    Mar 2006
    Posts
    55
    Here's a *great* htaccess guide I routinely refer to.

    http://perishablepress.com/press/200...access-tricks/

  5. #5
    Thank you very much all

  6. Newsletters

    Subscribe Now & Get The WHT Quick Start Guide!

Similar Threads

  1. htaccess redirect for entire directory
    By robertk1 in forum Programming Discussion
    Replies: 8
    Last Post: 10-05-2009, 02:18 PM
  2. htaccess redirect site pages...
    By acctman in forum Hosting Security and Technology
    Replies: 3
    Last Post: 04-25-2009, 02:21 PM
  3. My Entire Portfolio and Must Move Prices! ($5++)
    By CrazyTech in forum Domain Name Offers
    Replies: 10
    Last Post: 11-02-2005, 11:56 AM
  4. send users to different pages with htaccess
    By bazzo in forum Programming Discussion
    Replies: 4
    Last Post: 06-12-2004, 12:18 PM
  5. How to download an entire site? (images, pages, everything)
    By stupid99 in forum Running a Web Hosting Business
    Replies: 7
    Last Post: 03-31-2002, 10:22 PM

Related Posts from theWHIR.com

Posting Permissions

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