简体   繁体   中英

Mod rewrite (apache), existing dir

I have this rule:

RewriteRule ^/pictures/([A-Za-z0-9-/]+/)?([A-Za-z0-9-]+)-([0-9]+).jpg$ /pictures/$1/$3.jpg

But this rule not working, I think because the picture directory exists. If I change it to:

^/images/([A-Za-z0-9-/]+/)?([A-Za-z0-9-]+)-([0-9]+).jpg$ /pictures/$1/$3.jpg

Every thing is OK. How can I write a rule which will work with existing directories?

It should work even for existing dirs. Maybe the pattern is not correct; try this for example:

RewriteRule ^pictures/([A-Za-z0-9-/]+/)?([A-Za-z0-9-]+)-([0-9]+).jpg$ /pictures/$1/$3.jpg

(just removed the '/' at the begining)

You hava a htaccess file in Picture directory. delete it if you can or write the rule in pictures/.htaccess file

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM