为什么 .htaccess 阻止访问 .php 文件
我的网络服务器中有一个 .htaccess 文件,它从我的 URL 中删除了 index.php。 当我想访问位于网络服务器子目录中的 .php 文件时,问题就出现了。
我的 htacess 文件是这样的:
# Turn on URL rewriting
RewriteEngine On
# Installation directory
RewriteBase /
# Protect application and system files from being viewed
RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT]
现在如果我想访问这样的 .php 文件:
http://www.mydomain.com/subfolder/assets/17041f49/tiny_mce/tiny_mce_gzip.php
服务器返回 500 错误。
我应该怎么做才能解决这个问题?
谢谢。
I have a .htaccess file in my web server that removes index.php from my URL's.
The problem comes when I want to access a .php file located in a subdirectory of my webserver.
My htacess file is like this:
# Turn on URL rewriting
RewriteEngine On
# Installation directory
RewriteBase /
# Protect application and system files from being viewed
RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L]
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php/$0 [PT]
And now if I wanted to access a .php file like this:
http://www.mydomain.com/subfolder/assets/17041f49/tiny_mce/tiny_mce_gzip.php
The server returned an 500 error.
What should I do to fix this?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许你可以尝试:
然后使用 PHP 在 PHP 中获取请求的 URL
Maybe you could try:
Then get the requested URL in PHP usig