httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eugene Lee <list-apa...@fsck.net>
Subject Re: [users@httpd] Help with mod_rewrite
Date Wed, 26 May 2004 13:08:55 GMT
On Wed, May 26, 2004 at 02:14:05PM +0200, Johan Svedberg wrote:
: * May 26 13:54 André Malo <nd@perlig.de>:
: > * Johan Svedberg <johan@svedberg.pp.se> wrote:
: >
: > > How would I get RewriteRule /weblog/archives/?([^0-9]+)/ to exclude
: > > the match of /weblog/archives/index.php? A zero-width negative
: > > look-ahead regexp seems to be the solution, but I can't seem to  get
: > > the syntax for it right. Does mod_rewrite even support this?
: >
: > It does in 2.x, since PCRE are used there. But the better (faster) way
: > is probably:
: >
: > RewriteEngine On RewriteRule ^/weblog/archives/index.php$ - [L]
: > RewriteRule ^/weblog/archives/?([^0-9]+)/ yourreplacement
: 
: That does indeed work. Everything works well now, except for one thing.
: When I try to access /weblog/archives/ the second rule kicks in.
: However, with the latest addition, accessing /weblog/archives/index.php
: now works in the desired way. How would I make /weblog/archives/ behave
: in the same way? I hope this made any sence. :-)

How about adding another rule to redirect '/' to '/index.php'?

	RewriteEngine On
	RewriteBase /
	RewriteRule ^weblog/archives/$ weblog/archives/index.php [R]
	RewriteRule ^weblog/archives/index\.php$ - [L]
	RewriteRule ^weblog/archives/?([^0-9]+)/ /index.php?category_name=$1 [QSA]


-- 
Eugene Lee

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


Mime
View raw message