You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "R. M. Pretzlaw" <mi...@gmx.de> on 2009/12/28 13:51:34 UTC

[users@httpd] Configuration leads to error

Hello. Beside other configurations I got this VirtualHost:

     <VirtualHost *:200>
         DocumentRoot "D:/develop"

         <Directory "D:/develop">
             Options Indexes FollowSymLinks Includes ExecCGI
             AllowOverride All
             Order allow,deny
             Allow from all
         </Directory>

         Alias /foo G:/Documents/web/foo
     </VirtualHost>

     <Directory "G:/Documents/web/foo">
         Options -Indexes FollowSymLinks Includes ExecCGI
         AllowOverride All
         Order allow,deny
         Allow from all
     </Directory>

And in "G:/Documents/web/foo/trunk" this .htacces lines when i call
http://127.0.0.1:200/foo/trunk :

     RewriteRule ^[.]{0}$ _index.php?u= [L,QSA]
     RewriteRule ^([^_]+)$ _index.php?u=$1 [L,QSA]

But Apache can't find the file. It writes this in error.log :
"File does not exist: D:/develop/Documents"

So it seems that Alias doesn't take the drive-letter when rewriting an url.

Whats so confusing about my configutation?
How would it be right? (if I want a VirtualHost and a directory (like an
Alias) that is not in the DocumentRoot)


Greetings,
RMP

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Configuration leads to error

Posted by Eric Covener <co...@gmail.com>.
On Mon, Dec 28, 2009 at 10:27 AM, R. M. Pretzlaw <mi...@gmx.de> wrote:
>
> (Which others?)
> anyhow: all of them shall be fulfilled. The VirtualHost on Port 200, the
> "virtual" directory "/foo" and the forwards for non-existent subdirs of
> "/foo/trunk" to "/foo/trunk/_index.php?u={What-Ever-It-Was}". But in the
> last step the error occurs.
>
In your vhost:

RewriteLog c:/rw.log
RewriteLogLevel 9

recreate and pastebin the contents of the rewrite log along with the
full contents of the htaccess file.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Configuration leads to error

Posted by "R. M. Pretzlaw" <mi...@gmx.de>.
Eric Covener wrote:
>> Within an Alias "http://127.0.0.1:200/foo" that shall use
>> "G:/Documents/web/foo".
>
> If you stop here, does the Alias work?

Yes. If I turn the "Option Indexes" it shows all sub-directories. Even 
the mentioned .htacces is found in "/foo/trunk".

>> And in "/foo" there exists "/trunk" wich shall fetch all other subdirs that
>> are not existent (e.g. http://127.0.0.1:200/foo/trunk/Here/I/Am) and give
>> 'em to a special PHP (_index.php).
>
> Is this extra complication of mod_rewrite required to show some misbehavior?

I hope to write a appropriate answer: Until the RewriteRule comes in 
everythin works fine. But unfortunately this "forwarding" is important 
for the whole app.

Eric Covener wrote:
 > RewriteEngine on?
 > RewriteBase?

All well set (in .htaccess):
	RewriteEngine on
	RewriteBase /foo/trunk

 > Later in this thread you talk about testing for non-existent
 > subdirectories, are these other rules in the same context?

(Which others?)
anyhow: all of them shall be fulfilled. The VirtualHost on Port 200, the 
"virtual" directory "/foo" and the forwards for non-existent subdirs of 
"/foo/trunk" to "/foo/trunk/_index.php?u={What-Ever-It-Was}". But in the 
last step the error occurs.


Thanks to both of you for your time and help.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Configuration leads to error

Posted by Eric Covener <co...@gmail.com>.
On Mon, Dec 28, 2009 at 9:31 AM, R. M. Pretzlaw <mi...@gmx.de> wrote:
> Eric Covener wrote:
>>
>> Can you illustrate the same issue without any rewrite?
>
> I guess you mean this (sorry I have to train my English):
>
> There is a VirtualHost on Port 200 e.g.
> It's Document Root is "D:/develop".
> So every call of http://127.0.0.1:200 leads to this dir.
>
> Within an Alias "http://127.0.0.1:200/foo" that shall use
> "G:/Documents/web/foo". (Any other way of using this DocumentRoot for "/foo"
> are also welcome.)

If you stop here, does the Alias work?

>
> And in "/foo" there exists "/trunk" wich shall fetch all other subdirs that
> are not existent (e.g. http://127.0.0.1:200/foo/trunk/Here/I/Am) and give
> 'em to a special PHP (_index.php).

Is this extra complication of mod_rewrite required to show some misbehavior?

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Configuration leads to error

Posted by "R. M. Pretzlaw" <mi...@gmx.de>.
Eric Covener wrote:
> Can you illustrate the same issue without any rewrite?

I guess you mean this (sorry I have to train my English):

There is a VirtualHost on Port 200 e.g.
It's Document Root is "D:/develop".
So every call of http://127.0.0.1:200 leads to this dir.

Within an Alias "http://127.0.0.1:200/foo" that shall use 
"G:/Documents/web/foo". (Any other way of using this DocumentRoot for 
"/foo" are also welcome.)

And in "/foo" there exists "/trunk" wich shall fetch all other subdirs 
that are not existent (e.g. http://127.0.0.1:200/foo/trunk/Here/I/Am) 
and give 'em to a special PHP (_index.php).


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Configuration leads to error

Posted by Eric Covener <co...@gmail.com>.
On Mon, Dec 28, 2009 at 9:05 AM, R. M. Pretzlaw <mi...@gmx.de> wrote:

> The major problem in my case is, that the Alias and Rewriting doesn't
> contain the directory (as the error.log shows). It looks up the files in the
> wrong root.

Can you illustrate the same issue without any rewrite?

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Configuration leads to error

Posted by "R. M. Pretzlaw" <mi...@gmx.de>.
André Warnier wrote:
> Maybe the first thing is : why use a .htaccess file, when you evidently
> have access to the main server configuration.

Because I want to make an application not only for my apache. This makes 
it easier for end-users. But I give the hint, too.

> I am also a bit puzzled by your Rewrite rules :
> RewriteRule ^[.]{0}$ _index.php?u= [L,QSA]
> RewriteRule ^([^_]+)$ _index.php?u=$1 [L,QSA]

Examples:
http://127.0.0.1:200/foo/trunk/
-> no subdir given -> first rule -> "_index.php?u="

http://127.0.0.1:200/foo/trunk/Some/Subs
-> fictional subdirs -> second rule -> "_index.php?u=Some/Subs"


The major problem in my case is, that the Alias and Rewriting doesn't 
contain the directory (as the error.log shows). It looks up the files in 
the wrong root.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Configuration leads to error

Posted by André Warnier <aw...@ice-sa.com>.
R. M. Pretzlaw wrote:
> Whats so confusing about my configutation?

Maybe the first thing is : why use a .htaccess file, when you evidently 
have access to the main server configuration.
.htaccess files are probably to most over-used thing in Apache 
configurations, and they are quite inefficient, and often quite confusing.
The reason is basically that you are asking Apache to first walk down 
the whole file hierarchy, applying all applicable <Location> and 
<Directory> rules as it is doing so.
Then at the last level, Apache finds a .htaccess file that tells it to 
do something else. So it now has to restart at the beginning, and do it 
all over again.
If you need Rewrite rules, you can also put them right at the beginning 
of your Apache configuration file, or inside of a <Directory> section.
In my opinion, .htaccess files make sense only in the case where your 
system's main configuration is not accessible, and you only can use a 
.htaccess file inside a directory to which you do have access.

I am also a bit puzzled by your Rewrite rules :
     RewriteRule ^[.]{0}$ _index.php?u= [L,QSA]
     RewriteRule ^([^_]+)$ _index.php?u=$1 [L,QSA]

what is the first one supposed to match ? to me it looks like matching a 
URL composed of "a dot character, zero times". ??
What are you trying to match ?
Can you give an example of a URL, and what you would like it to be 
rewritten as ?






---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Configuration leads to error

Posted by Eric Covener <co...@gmail.com>.
> And in "G:/Documents/web/foo/trunk" this .htacces lines when i call
> http://127.0.0.1:200/foo/trunk :
>
>    RewriteRule ^[.]{0}$ _index.php?u= [L,QSA]
>    RewriteRule ^([^_]+)$ _index.php?u=$1 [L,QSA]


RewriteEngine on?
RewriteBase?

Later in this thread you talk about testing for non-existent
subdirectories, are these other rules in the same context?

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org