Current location: Hot Scripts Forums » Other Discussions » Web Servers » Redirect directories


Redirect directories

Reply
  #1 (permalink)  
Old 09-26-08, 05:14 AM
Deansatch Deansatch is offline
Coding Addict
 
Join Date: Jul 2006
Location: Northumberland
Posts: 375
Thanks: 0
Thanked 0 Times in 0 Posts
Redirect directories

Is there a way to redirect a every file in a directory to one new location without writing each one out in htaccess?

e.g.
Code:
oldsite.com/dir1/page1.php
oldsite.com/dir1/page2.php
oldsite.com/dir1/anotherdir/page2.php
oldsite.com/dir1/anotherdir/page5.php
all redirect to:

Code:
http://newsite.com/newdir/index.php
at the moment, the only way I know is by doing this:
Code:
Redirect oldsite.com/dir1/page1.php http://newsite.com/newdir/index.php
Redirect oldsite.com/dir1/page2.php http://newsite.com/newdir/index.php
Redirect oldsite.com/dir1/anotherdir/page2.php http://newsite.com/newdir/index.php
Redirect oldsite.com/dir1/anotherdir/page5.php http://newsite.com/newdir/index.php
But there are a lot of pages and a lot of directories that need redirecting to their new relative pages.
NOTE: I don't want to redirect every page from the old site to the same place. I want to redirect each old directory from the old site to a relevant page on the new site.
__________________
Aye!

Last edited by Deansatch; 09-26-08 at 05:17 AM.
Reply With Quote
  #2 (permalink)  
Old 09-26-08, 03:10 PM
wirehopper's Avatar
wirehopper wirehopper is offline
-
 
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
Reply With Quote
  #3 (permalink)  
Old 09-28-08, 02:39 AM
loveloop loveloop is offline
Newbie Coder
 
Join Date: Aug 2008
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Subdomain redirect rodrico101 Web Servers 0 08-30-08 08:31 PM
please help me with redirect page Hoangsts ASP 3 12-08-06 08:58 AM
script that updates a file but in many directories nick1 Perl 6 02-13-05 03:27 AM
script that updates one file but in many directories nick1 Script Requests 0 04-27-04 12:21 PM


All times are GMT -5. The time now is 01:28 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.