Php Mod rewrite(apache),现有目录
我有一条规则:Php Mod rewrite(apache),现有目录,php,apache,mod-rewrite,directory,Php,Apache,Mod Rewrite,Directory,我有一条规则: RewriteRule ^/pictures/([A-Za-z0-9-/]+/)?([A-Za-z0-9-]+)-([0-9]+).jpg$ /pictures/$1/$3.jpg 但是这个规则不起作用,我想是因为图片目录存在。如果我将其更改为: ^/images/([A-Za-z0-9-/]+/)?([A-Za-z0-9-]+)-([0-9]+).jpg$ /pictures/$1/$3.jpg 一切都好。我怎样才能编写一个规则来处理现有目录?它应该可以处理现有目录。可能模
RewriteRule ^/pictures/([A-Za-z0-9-/]+/)?([A-Za-z0-9-]+)-([0-9]+).jpg$ /pictures/$1/$3.jpg
但是这个规则不起作用,我想是因为图片目录存在。如果我将其更改为:
^/images/([A-Za-z0-9-/]+/)?([A-Za-z0-9-]+)-([0-9]+).jpg$ /pictures/$1/$3.jpg
一切都好。我怎样才能编写一个规则来处理现有目录?它应该可以处理现有目录。可能模式不正确;请尝试以下示例:
RewriteRule ^pictures/([A-Za-z0-9-/]+/)?([A-Za-z0-9-]+)-([0-9]+).jpg$ /pictures/$1/$3.jpg
(刚从开头删除了“/”)即使对于现有的dir,它也应该有效。可能模式不正确;请尝试以下示例:
RewriteRule ^pictures/([A-Za-z0-9-/]+/)?([A-Za-z0-9-]+)-([0-9]+).jpg$ /pictures/$1/$3.jpg
(刚删除开头的“/”)图片目录中有一个htaccess文件。
如果可以,请将其删除或将规则写入pictures/.htaccess文件您在Picture目录中有一个htaccess文件。
如果可以,请删除它,或者在pictures/.htaccess文件中写入规则我认为picture dir是别名。它可能有问题。我认为图片目录是别名。这可能是个问题。