Apache Server configuration support - mod_rewrite issue. Automaticly appends .php

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > March 2005 > mod_rewrite issue. Automaticly appends .php





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author mod_rewrite issue. Automaticly appends .php
Evert | Rooftop

2005-03-24, 5:53 pm

Hi people,

I'm having a problem with mod_rewrite. This is my .htaccess configuration:

RewriteEngine On
RewriteBase /~evert/dev/sabretooth/s41/util
RewriteRule ^(.*) dispatcher.php?SURI=$1 [QSA,NE,L]

Which works fine for most url's like
/~evert/dev/sabretooth/s41/util/rss
/~evert/dev/sabretooth/s41/util/xml

but when I try to use the uri

/~evert/dev/sabretooth/s41/util/amf

something goes horrible wrong, it somehow redirects to

/~evert/dev/sabretooth/s41/util/dispatcher.php?SURI=amf.php

this are the rewritelogs:

10.0.0.1 - - [24/Mar/2005:11:24:58 +0100]
[absinth.rooftopsolutions.nl/sid#810b3e4][rid#80a376c/initial] (1) pass
through /~evert/dev/sabretooth/s41/util/amf
10.0.0.1 - evert [24/Mar/2005:11:24:58 +0100]
absinth.rooftopsolutions.nl/sid#810b3e4][rid#80a376c/initial] (2)
[per-dir /home/evert/public_html/dev/sabretooth/s41/util/] rewrite
amf.php -> dispatcher.php?SURI=amf.php
10.0.0.1 - evert [24/Mar/2005:11:24:58 +0100]
[absinth.rooftopsolutions.nl/sid#810b3e4][rid#80a376c/initial] (2)
[per-dir /home/evert/public_html/dev/sabretooth/s41/util/] trying to
replace prefix /home/evert/public_html/dev/sabretooth/s41/util/ with
/~evert/dev/sabretooth/s41/util
10.0.0.1 - evert [24/Mar/2005:11:24:58 +0100]
[absinth.rooftopsolutions.nl/sid#810b3e4][rid#80a376c/initial] (1)
[per-dir /home/evert/public_html/dev/sabretooth/s41/util/] internal
redirect with /~evert/dev/sabretooth/s41/util/dispatcher.php [INTERNAL
REDIRECT]
10.0.0.1 - evert [24/Mar/2005:11:24:58 +0100]
[absinth.rooftopsolutions.nl/sid#810b3e4][rid#81749bc/initial/redir#1]
(2) init rewrite engine with requested uri
/~evert/dev/sabretooth/s41/util/dispatcher.php
10.0.0.1 - evert [24/Mar/2005:11:24:58 +0100]
[absinth.rooftopsolutions.nl/sid#810b3e4][rid#81749bc/initial/redir#1]
(1) pass through /~evert/dev/sabretooth/s41/util/dispatcher.php
10.0.0.1 - evert [24/Mar/2005:11:24:58 +0100]
[absinth.rooftopsolutions.nl/sid#810b3e4][rid#81749bc/initial/redir#1]
(2) [per-dir /home/evert/public_html/dev/sabretooth/s41/util/] rewrite
dispatcher.php -> dispatcher.php?SURI=dispatcher.php
10.0.0.1 - evert [24/Mar/2005:11:24:58 +0100]
[absinth.rooftopsolutions.nl/sid#810b3e4][rid#81749bc/initial/redir#1]
(1) [per-dir /home/evert/public_html/dev/sabretooth/s41/util/] initial
URL equal rewritten URL:
/home/evert/public_html/dev/sabretooth/s41/util/dispatcher.php [IGNORING
REWRITE]

If there's more information I can supply I'll be glad to supply it.

regards,
Evert
Evert | Rooftop

2005-03-24, 5:53 pm

I have found the problem. There is an amf.php in the same directory. Any
ideas on how to ignore this with mod_rewrite?

regards,
Evert

Evert | Rooftop wrote:
> Hi people,
>
> I'm having a problem with mod_rewrite. This is my .htaccess configuration:
>
> RewriteEngine On
> RewriteBase /~evert/dev/sabretooth/s41/util
> RewriteRule ^(.*) dispatcher.php?SURI=$1 [QSA,NE,L]
>
> Which works fine for most url's like
> /~evert/dev/sabretooth/s41/util/rss
> /~evert/dev/sabretooth/s41/util/xml
>
> but when I try to use the uri
>
> /~evert/dev/sabretooth/s41/util/amf
>
> something goes horrible wrong, it somehow redirects to
>
> /~evert/dev/sabretooth/s41/util/dispatcher.php?SURI=amf.php
>
> this are the rewritelogs:
>
> 10.0.0.1 - - [24/Mar/2005:11:24:58 +0100]
> [absinth.rooftopsolutions.nl/sid#810b3e4][rid#80a376c/initial] (1) pass
> through /~evert/dev/sabretooth/s41/util/amf
> 10.0.0.1 - evert [24/Mar/2005:11:24:58 +0100]
> absinth.rooftopsolutions.nl/sid#810b3e4][rid#80a376c/initial] (2)
> [per-dir /home/evert/public_html/dev/sabretooth/s41/util/] rewrite
> amf.php -> dispatcher.php?SURI=amf.php
> 10.0.0.1 - evert [24/Mar/2005:11:24:58 +0100]
> [absinth.rooftopsolutions.nl/sid#810b3e4][rid#80a376c/initial] (2)
> [per-dir /home/evert/public_html/dev/sabretooth/s41/util/] trying to
> replace prefix /home/evert/public_html/dev/sabretooth/s41/util/ with
> /~evert/dev/sabretooth/s41/util
> 10.0.0.1 - evert [24/Mar/2005:11:24:58 +0100]
> [absinth.rooftopsolutions.nl/sid#810b3e4][rid#80a376c/initial] (1)
> [per-dir /home/evert/public_html/dev/sabretooth/s41/util/] internal
> redirect with /~evert/dev/sabretooth/s41/util/dispatcher.php [INTERNAL
> REDIRECT]
> 10.0.0.1 - evert [24/Mar/2005:11:24:58 +0100]
> [absinth.rooftopsolutions.nl/sid#810b3e4][rid#81749bc/initial/redir#1]
> (2) init rewrite engine with requested uri
> /~evert/dev/sabretooth/s41/util/dispatcher.php
> 10.0.0.1 - evert [24/Mar/2005:11:24:58 +0100]
> [absinth.rooftopsolutions.nl/sid#810b3e4][rid#81749bc/initial/redir#1]
> (1) pass through /~evert/dev/sabretooth/s41/util/dispatcher.php
> 10.0.0.1 - evert [24/Mar/2005:11:24:58 +0100]
> [absinth.rooftopsolutions.nl/sid#810b3e4][rid#81749bc/initial/redir#1]
> (2) [per-dir /home/evert/public_html/dev/sabretooth/s41/util/] rewrite
> dispatcher.php -> dispatcher.php?SURI=dispatcher.php
> 10.0.0.1 - evert [24/Mar/2005:11:24:58 +0100]
> [absinth.rooftopsolutions.nl/sid#810b3e4][rid#81749bc/initial/redir#1]
> (1) [per-dir /home/evert/public_html/dev/sabretooth/s41/util/] initial
> URL equal rewritten URL:
> /home/evert/public_html/dev/sabretooth/s41/util/dispatcher.php [IGNORING
> REWRITE]
>
> If there's more information I can supply I'll be glad to supply it.
>
> regards,
> Evert

Evert | Rooftop

2005-03-25, 8:50 pm

My problem has evolved into another one, after I deleted the .htaccess
files I can open a php file in the util dir, without having to add the
..php extension

So, the file is:
debugger2.php

and I can open it by the urls:
util/debugger2.php
util/debugger2

No weird stuff in httpd.conf, no .htaccess. It only occurs in this
directory.

Any ideas?

grt,
Evert

Evert | Rooftop wrote:
> I have found the problem. There is an amf.php in the same directory. Any
> ideas on how to ignore this with mod_rewrite?
>
> regards,
> Evert
>

Evert | Rooftop

2005-03-30, 6:03 pm

My problem has evolved into another one, after I deleted the .htaccess
files I can open a php file in the util dir, without having to add the
..php extension

So, the file is:
debugger2.php

and I can open it by the urls:
util/debugger2.php
util/debugger2

No weird stuff in httpd.conf, no .htaccess. It only occurs in this
directory.

Any ideas?

grt,
Evert

Evert | Rooftop wrote:
> I have found the problem. There is an amf.php in the same directory. Any
> ideas on how to ignore this with mod_rewrite?
>
> regards,
> Evert
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com