Forum Moderators: phranque

Message Too Old, No Replies

Problem Rewrite with dir

         

webstyler

9:14 am on Nov 21, 2003 (gmt 0)

10+ Year Member



Hi

I use this

RewriteRule ^([^/]+).html mylink.php?e=$1 [l]

BUT I have a problem with a dir called html

if I open a file img :
http://www.mysite.com/net/img.gif -> OK
http://www.mysite.com/net/html/img.gif -> ERROR

the second redirect to mylink.php...

?

[edited by: jdMorgan at 5:18 am (utc) on Nov. 24, 2003]
[edit reason] De-linked [/edit]

closed

4:39 pm on Nov 21, 2003 (gmt 0)

10+ Year Member



Changing your pattern from this:

^([^/]+).html

to this:

([^/]+)\.html$

Should do what you want. The backslash makes the pattern match files that contain .html, and the end anchor makes the pattern match only files with the .html extension. The start anchor shouldn't be necessary, so I removed it.

webstyler

5:43 pm on Nov 21, 2003 (gmt 0)

10+ Year Member



thks :))

this morning I have first modified with this

RewriteRule ^([^/]+).html$ autonotizie_marca.php?m=$1 [l]

now I used your row

RewriteRule ([^/]+)\.html$ autonotizie_marca.php?m=$1 [l]

thks a lot ;)

closed

2:59 am on Nov 24, 2003 (gmt 0)

10+ Year Member



You're welcome, webstyler.

Glad to see it works.