Apache mod_rewrite rules issue?

This is a discussion on Apache mod_rewrite rules issue? within the Apache Web Server forums, part of the Web Server and Related Forums category; This is the contents of .htaccess: RewriteEngine On RewriteRule ^/admin/?$ /fof/admin.php [L] RewriteRule ^/admin/logout/?$ /fof/admin.php?...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-17-2008
Hector
 
Posts: n/a
Default Apache mod_rewrite rules issue?

This is the contents of .htaccess:

RewriteEngine On

RewriteRule ^/admin/?$ /fof/admin.php [L]
RewriteRule ^/admin/logout/?$ /fof/admin.php?f=logout [L]

The contents of admin.php can be found here:
http://svn.thegot.org/forbes_office_furniture/admin.php
The web accessible URL is: http://dev.thegot.org/fof/admin

--

The second rewrite rule does not seem to be functioning properly.
Maybe there is something wrong syntactically, but I have yet to find
it. The strange part is that if I alter the second rewrite rule (^/
admin to ^/adm) to:

RewriteRule ^/adm/logout/?$ /fof/admin.php?f=logout [L]

Or anything under 5 characters, everything works. Hopefully, I'm
making a very simple mistake, but any help here would be appreciated.
Thank you.
  #2 (permalink)  
Old 06-17-2008
HansH
 
Posts: n/a
Default Re: Apache mod_rewrite rules issue?

"Hector" <hectcastro@gmail.com> schreef in bericht
news:40e606ed-651b-4458-ab9f-ae573b130c4d@e39g2000hsf.googlegroups.com...
> This is the contents of .htaccess:
> RewriteEngine On
> RewriteRule ^/admin/?$ /fof/admin.php [L]
> RewriteRule ^/admin/logout/?$ /fof/admin.php?f=logout [L]


In .htaccess the pattern should not start with /
If this .htacces is in the folder /admin drop it from the pattern and
add the line
RewriteBase /

> --

Due to the -- some news readers have stopped here.

> The second rewrite rule does not seem to be functioning properly.
> Maybe there is something wrong syntactically, but I have yet to find
> it. The strange part is that if I alter the second rewrite rule (^/
> admin to ^/adm) to:
>
> RewriteRule ^/adm/logout/?$ /fof/admin.php?f=logout [L]
>
> Or anything under 5 characters, everything works.

Looks like /admin is in use by your hosting provider.

HansH


  #3 (permalink)  
Old 06-17-2008
Hector
 
Posts: n/a
Default Re: Apache mod_rewrite rules issue?

On Jun 17, 3:38*pm, "HansH" <ha...@invalid.invalid> wrote:
> "Hector" <hectcas...@gmail.com> schreef in berichtnews:40e606ed-651b-4458-ab9f-ae573b130c4d@e39g2000hsf.googlegroups.com...
>
> > This is the contents of .htaccess:
> > RewriteEngine On
> > RewriteRule ^/admin/?$ /fof/admin.php [L]
> > RewriteRule ^/admin/logout/?$ /fof/admin.php?f=logout [L]

>
> In .htaccess the pattern should not start with /
> If this .htacces is in the folder /admin drop it from the pattern and
> add the line
> * * RewriteBase /
>
> > --

>
> Due to the -- some news readers have stopped here.
>
> > The second rewrite rule does not seem to be functioning properly.
> > Maybe there is something wrong syntactically, but I have yet to find
> > it. *The strange part is that if I alter the second rewrite rule (^/
> > admin to ^/adm) to:

>
> > RewriteRule ^/adm/logout/?$ /fof/admin.php?f=logout [L]

>
> > Or anything under 5 characters, everything works.

>
> Looks like /admin is in use by your hosting provider.
>
> HansH


There is no "admin" directory. admin.php is located in the web site's
root directory. Adjusting the .htaccess to what you see below still
does not work for first RewriteRule parameter "admin" but works for
"adm". Also, I do not believe /admin is in use by my provider because
this is on my own machine.

RewriteEngine On
RewriteBase /

RewriteRule ^admin/?$ /fof/admin.php [L]
RewriteRule ^admin/logout/?$ /fof/admin.php?f=logout [L]
  #4 (permalink)  
Old 06-18-2008
HansH
 
Posts: n/a
Default Re: Apache mod_rewrite rules issue?

"Hector" <hectcastro@gmail.com> schreef in bericht
news:4ee88310-2eb7-47c3-9bc7-f0dac90188f6@z72g2000hsb.googlegroups.com...
>>> RewriteRule ^/adm/logout/?$ /fof/admin.php?f=logout [L]
>>> Or anything under 5 characters, everything works.

>>
>> Looks like /admin is in use by your hosting provider.

>
> There is no "admin" directory. admin.php is located in the web site's
> root directory. Adjusting the .htaccess to what you see below still
> does not work for first RewriteRule parameter "admin" but works for
> "adm".

IOW no changes: admin is in virtual use by another application

> Also, I do not believe /admin is in use by my provider because
> this is on my own machine.

Thus you're your own hosting provider ... ask yourself ;-)

You're on Ubuntu 5.10, right?
Check your Apache's config files for reference to /admin:
grep -Ri admin /etc/apache2/*

> RewriteEngine On
> RewriteBase /

For the records:
- only required if .htaccess and result of rewrite are in dfferent file
trees
- .htaccess in document root is a performance penalty:
it is evaluated -and eating CPU time- for any request;
/admin/.htaccess is about only evaluated when needed

> RewriteRule ^admin/?$ /fof/admin.php [L]
> RewriteRule ^admin/logout/?$ /fof/admin.php?f=logout [L]


HansH


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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



All times are GMT +1. The time now is 10:54 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0