hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : How to move entire site except a few pages with htaccess
Reply

Forum Jump

How to move entire site except a few pages with htaccess

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 12-25-2009, 03:39 AM
nee4 nee4 is offline
Newbie
 
Join Date: Nov 2009
Posts: 24

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?



Sponsored Links
  #2  
Old 12-25-2009, 04:20 AM
madaboutlinux madaboutlinux is offline
Web Hosting Master
 
Join Date: Jul 2009
Posts: 1,543
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:

Quote:
<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  
Old 12-25-2009, 09:45 AM
david510 david510 is offline
Web Hosting Master
 
Join Date: Oct 2004
Location: Kerala, India
Posts: 4,708
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

Sponsored Links
  #4  
Old 12-25-2009, 07:47 PM
TotalZen TotalZen is offline
Junior Guru Wannabe
 
Join Date: Mar 2006
Posts: 55
Here's a *great* htaccess guide I routinely refer to.

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

  #5  
Old 12-27-2009, 06:18 AM
nee4 nee4 is offline
Newbie
 
Join Date: Nov 2009
Posts: 24
Thank you very much all

Reply

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

Related posts from TheWhir.com
Title Type Date Posted
Mistakes To Avoid When Launching A New Website Design Blog 2014-01-10 10:53:50
Mozilla Firefox 23 Will Block Mix SSL Content by Default Web Hosting News 2013-04-12 11:39:07
CDN Akamai Confirms Syrian Internet Blackout in Midst of Civil War Web Hosting News 2012-11-29 16:08:43
How Website Design Affects Conversion Rates Blog 2012-09-28 13:52:36
Website Tools Provider Zoho Launches Website Builder with Free Hosting Web Hosting News 2013-02-25 10:27:39


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?