我正在尝试在INDEX.php页面上添加图片,但是当我通过在地址栏中输入网址来访问图片时我的HTACCESS阻止它显示空页
我正在尝试从http://127.0.0.1/ase/ts/
当我访问http://127.0.0.1/ase/ts/help.gif
时,页面加载速度很慢,而且根本没有显示任何内容。
我无法从/ASE/{SUBDIRECTORY}/
/ASE
目录的<.HTACCESS文件
RewriteEngine On
RewriteRule ^(|/)$ index.php?url=$1
RewriteRule ^([a-zA-Z0-9_-]+)(|/)$ index.php?url=$1
RewriteRule ^([^/]+)/([^/]+)$ index.php?url=$1&page=$2 [NC,L]
RewriteRule ^(.*)\.htm$ $1.php [NC]
我认为这是因为这条规则。
RewriteRule ^([^/]+)/([^/]+)$ index.php?url=$1&page=$2 [NC,L]
我正在重写127.0.0.1/ase/index.php?url=dash
到127.0.0.1/ase/dash
和127.0.0.1/ase/index.php?url=cmdlogs?p=1
到127.0.0.1/ase/cmdlogs/1
答案 0 :(得分:0)
您要问的是:如果文件存在,则避免重定向。
在这种情况下,在违规的RewriteRules之前添加这一行:
RewriteCond %{SCRIPT_FILENAME} !-f
这将完全检查并跳过你的重写。 请注意,现在只有那些会给你404的路由会被重写到你的索引文件中,所以请确保你的公共文件夹周围没有多少文件。