Web Design and Development Forums

Rewrite Server Root per Subfolder

This is a discussion on "Rewrite Server Root per Subfolder" within the Apache and IIS section. This forum, and the thread "Rewrite Server Root per Subfolder are both part of the Hosting Related category.


Go Back   Webforumz.com > Hosting Related > Apache and IIS

Welcome to Webforumz.com.
Register Now Register now!

Reply
 
LinkBack Thread Tools Rate Thread
Old Nov 11th, 2007, 20:10   #1 (permalink)
Chief Moderator
 
aso186's Avatar
 
Join Date: Oct 2007
Location: UK
Posts: 701
Blog Entries: 2
Send a message via Skype™ to aso186
Question Rewrite Server Root per Subfolder

On my desktop (for when I'm working on sites) I've got the server root configured in httpd.conf set to D:/Sites which works fine. But within the folder 'Sites' I have about 2 or 3 subfolders for the various sites I'm currently working on.

Most of these sites make use of the 'pre-slash' on anchors to refer to the server root, such as
Code: Select all
<a href="/about/" title="About Us">About Us</a>
The idea is a page 'index.html' buried in www.myexample.com/foo/this/index.html with the above anchor, will link to www.myexample.com/about/.

Of course, if my entire site is in a subfolder D:/Sites/Foo, then the same page 'index.html' will link to D:/Sites/about/ instead of D:/Sites/Foo/about/.

I also have a similar problem using $_SERVER['DOCUMENT_ROOT'] for php includes

Basically is there a way I can rewrite the server root per subfolder (i.e using htaccess), so that similar url's and includes refer to the relative sub folder, rather than the configured root (D:/Sites)?

Many thanks

Alex
aso186 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
rewrite URL name? nate2099 HTML Forum 1 Feb 25th, 2008 10:33
mod rewrite alexgeek Apache and IIS 7 Sep 5th, 2007 22:56
Can I put style sheet in the root folder that targets a specific html page badger CSS Forum 3 Jul 14th, 2007 17:35
phpMyAdmin - how do I give it my root password? Colm Osiris MySQL 1 Nov 7th, 2006 15:10
Setting the web root carriker Hosting & Domains 5 Mar 14th, 2006 18:47



Latest Updates

All Points SEO Security Advisory - CHECK YOUR SITE NOW!

Creative Coding :: February 2008

Webforumz is sponsored by: WESH UK Web Hosting
All times are GMT. The time now is 06:28.

Sleep Study Scoring :: Free Bet :: Website Templates :: Online Betting :: Bookmakers :: Funny Quotes :: Internet Recruitment Software :: Microsoft CRM Experts :: Online Casino :: Decorated Christmas Trees :: Midwife Forums :: Football Betting :: Ecommerce Software :: Web Hosting :: Football Stats :: Dry Cleaning Collection :: xtreme wales - extreme clothing :: Apuestas :: Sharepoint Consultants :: Website Optimisation :: Office Clearance London :: Sharepoint Experts :: Sports Betting :: Casino :: Website Templates :: Web Design Development India :: Online Gambling

Powered by: vBulletin Version 3.7, Copyright ©2000 - 2008, Jelsoft Enterprises Limited.
© 2003-2008 Webforumz.com : All Rights Reserved
Search Engine Friendly URLs by vBSEO 3.2.0 RC6


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59