WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-17-2004, 02:30 PM
WebProWorld Pro
 

Join Date: Jul 2003
Location: UK
Posts: 154
PhilC RepRank 0
Default mod_rewrite, .htaccess and the root directory problem

I'm having a problem with using mod_rewrite on a per-directory basis when the directory is the site's root directory. I want all requests for files in the site's root directory to be rewritten (redirected) to my script.

I've put the .htaccess file in the root directory and included RewriteBase / in it (although I don't think that line is necessary).

If a requested file actually exists in the root directory, then the request is rewritten (redirected) to my script file. But when the requested file does not exist, a 403 (forbidden) message is returned.

If the whole thing is done in a sub-directory, then everything works ok, and requested files need not exist.

I've been looking at the difference between the physical and URL paths, but I don't think the answer lies there, or it wouldn't work in a sub-directory.

Anyone got any idea of how to rewrite (redirect) all file requests for files in the site's root directory to my script using mod_rewrite with the .htaccess file?
__________________
PhilC
SEO articles, information and seo forums
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , , , ,



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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0