Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirecting to Sub-Directory of Current Directory 1

Status
Not open for further replies.

faelord

Technical User
Jan 4, 2002
6
GB
We currently hold various examinations and answer papers in our tests directory. However this is becoming unmanageable with the number of files and so we want to give each course its own subdirectory inside tests, /tests/intro_01 /tests/intro_02 etc. Obviously we don't want to lose calls to files currently in tests as many have bookmarked that area and we want to redirect those to the intro_01 subdirectory

The following however in httpd.conf sends the browser into an infinite loop:

Redirect permanent /tests/
We need to redirect only those calls to the main tests directory and not those to the subdirectories. Probably I need to do something with regex but thats beyond me. Any help would be much appreciated therefore.

Os
 
Hi mate,

I may be wrong but I think that you may need to add each page to redirect seperatly..

Redirect permanent /tests/page1.html
Redirect permanent /tests/page2.html
I suppose it depends the amount of pages you are talking about..

Hope this helps Wullie

 
Hi,

I did have a quick go at this with mod_rewrite but just getting the same 'loop' errors as with the redirect. I might have another go later if I get some time but it would be much easier if the new directories were not in the path of the old. For example the redirect / rewrite was to /intro 01/ instead of /tests/intro 01/ . Its the fact that it still retains the 'tests' bit that causes the looping.

Otherwise, as wullies says, use very specific rules instead.

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top