All pastes #826803 Raw Edit

mod_rewrite Problem

public text v1 · immutable
#826803 ·published 2007-12-21 12:59 UTC
rendered paste body
RewriteEngine On
	
RewriteCond %(REQUEST_FILENAME) !-f
RewriteRule ^(.*[^/])$ /BG/$1/
	
RewriteCond %{REQUEST_URI} !index.php [NC]
RewriteCond %{REQUEST_URI} !/BG/css [NC]
RewriteRule ^(.*?)/(.*)/$ index.php?id=$1&sub=$2 [L]




> Main Idea was that a request for /BG/something/more gets first converted to /BG/something/more/ and then to 
> /BG/index.php?id=something&sub=more

> However it sometimes either produces something along the lines of /BG/index.php?id=index.php

of course, index.php matches the (.*)  in your second rule, adding that cond should do the trick

> Any help is appreciated ^^

welcome