Configuration leads to error

Configuration leads to error

am 28.12.2009 13:51:34 von mikescript

Hello. Beside other configurations I got this VirtualHost:


DocumentRoot "D:/develop"


Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all


Alias /foo G:/Documents/web/foo



Options -Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all


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 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: Configuration leads to error

am 28.12.2009 14:25:59 von aw

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 and
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 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 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: Configuration leads to error

am 28.12.2009 15:05:40 von mikescript

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 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: Configuration leads to error

am 28.12.2009 15:11:55 von Eric Covener

On Mon, Dec 28, 2009 at 9:05 AM, R. M. Pretzlaw 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 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: Configuration leads to error

am 28.12.2009 15:31:58 von mikescript

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 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: Configuration leads to error

am 28.12.2009 15:38:23 von Eric Covener

On Mon, Dec 28, 2009 at 9:31 AM, R. M. Pretzlaw 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 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: Configuration leads to error

am 28.12.2009 15:39:45 von Eric Covener

> And in "G:/Documents/web/foo/trunk" this .htacces lines when i call
> http://127.0.0.1:200/foo/trunk :
>
> =A0 =A0RewriteRule ^[.]{0}$ _index.php?u=3D [L,QSA]
> =A0 =A0RewriteRule ^([^_]+)$ _index.php?u=3D$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?

--=20
Eric Covener
covener@gmail.com

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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: Configuration leads to error

am 28.12.2009 16:27:44 von mikescript

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 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: Configuration leads to error

am 28.12.2009 16:45:14 von Eric Covener

On Mon, Dec 28, 2009 at 10:27 AM, R. M. Pretzlaw 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 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