Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

Apache Rewrite fails to find index.*

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  Apache doesn't exec perl  
Author Message
nospam198

External


Since: Jan 10, 2004
Posts: 2



(Msg. 1) Posted: Sat Jan 10, 2004 12:18 pm
Post subject: Apache Rewrite fails to find index.*
Archived from groups: alt>apache>configuration (more info?)

This is my first time around the block with Apache (1.3.29 Linux)
RewriteRule and I'm running into a situation I don't understand.
Unfortunately, I'm on a commercial account that has only .htaccess control
so am unable to turn on rewrite logging for more info. While I can talk to
my hosting service about that, I keep thinking that there's something very
fundamental I'm not understanding so thought I'd try this forum first to see
if someone could explain where I'm going wrong.

The problem stems from the fact that my hosting service allows me to map a
number of add-on domains, each of which has its own content. As new add-on
domains are configured, the directory space on the server is divided up as
follows:

www // registered domain dir
index.html // registered domain index page
addon1 // addon1 subdir
index.html // addon1 index page
addon2 // addon2 subdir
index.html // addon2 index page

I tend to be organized so decided that a simple reconfiguration was in order
to insure that all my addon subdirectories don't get mixed in with my
registered domain content. It seemed simple enough to configure the
directory as follows:

www // top level now contains only subdirs
regdomain // registered domain dir
index.html // registered domain index page
addon1 // addon1 subdir
index.html // addon1 index page
addon2 // addon2 subdir
index.html // addon2 index page

and use RewriteRule point requests for the registered domain into the
regdomain folder:

## Rewrite Rule for www.regdomain.net
RewriteCond %{HTTP_HOST} ^www.regdomain.net$
RewriteCond %{REQUEST_URI} !regdomain/
RewriteRule ^(.*)$ regdomain/$1 [L]
RewriteRule ^/$ regdomain [L]
RewriteRule ^$ regdomain [L]
## Rewrite Rule for regdomain.net
RewriteCond %{HTTP_HOST} ^regdomain.net$
RewriteCond %{REQUEST_URI} !regdomain/
RewriteRule ^(.*)$ regdomain/$1 [L]
RewriteRule ^/$ regdomain [L]
RewriteRule ^$ regdomain [L]

When I use a url like www.regdomain.net/somefile.html, this works fine and
the rewrite displays somefile.html from the regdomain folder. What I don't
understand is that when I use a url like www.regdomain.net, the rewrite
fails. Using a bit of php, I can see that the url www.regdomain.net produces
the following:

HTTP_HOST = string(1) "/"
REQUEST_URI = string(17) "www.regdomain.net"

It seems to me that my RewriteRule must be wrong but I'm not seeing my
error. I'm hoping this will be obvious to someone who's familiar with
Rewrites.

Thanks!

 >> Stay informed about: Apache Rewrite fails to find index.* 
Back to top
Login to vote
nospam198

External


Since: Jan 10, 2004
Posts: 2



(Msg. 2) Posted: Sat Jan 10, 2004 5:02 pm
Post subject: Re: Apache Rewrite fails to find index.* [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

I'm not sure how I managed to miss this previously, but all's well with:

## Rewrite Rule for www.regdomain.net
RewriteCond %{HTTP_HOST} ^www.regdomain.net$
RewriteCond %{REQUEST_URI} !regdomain/
RewriteRule ^(.*)$ regdomain/$1
## Rewrite Rule for regdomain.net
RewriteCond %{HTTP_HOST} ^regdomain.net$
RewriteCond %{REQUEST_URI} !regdomain/
RewriteRule ^(.*)$ regdomain/$1

Sorry for the false alarm.

 >> Stay informed about: Apache Rewrite fails to find index.* 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Index Server on Apache? - Good afternoon, Does anyone know if Apache has an equivalent of IIS's Index Server - or alternatively is there an easy method for searching documents for keywords, using Apache? Many thanks in advance. Cheers, Andy

Apache not displaying index.html.en - Hey all, Just installed Apache 2. When i type http://server/manual - i get a 404 If i type http://server/manual/index.html.en it works, and shows the index page. Also, any link from the index page fails, because the links are to ..html but the files..

Newbie question - Apache can't find cgi-bin - Please let me know if there are any newbie doc's out there. I still haven't learned the terminology well enough to find much in the Apache documentation. I'm just setting up a local website (SUSE 7.3). Apache can't seem to find /cgi-bin/ which is....

Apache Rewrite Rules - Hello, I have compiled mod_rewrite and mod_proxy into my apache 1.3.x server and are trying to rewrite any requests that come into the server for files in my cgi-bin/ directory to another apache server running on port 8080. I have tried these two rule...

Apache 2.0: Cannot automatically server index.html - I am running 2.0.40 on Redhat 8.0 and I cannot get the server display the index.html when I go to http://www.mydomain.com. Instead, I get the If I specify http://www.mydomain.com/index.html, then the page is returned properly. I first tried configuring....
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]