<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /homepage/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /homepage/index.php [L]
</IfModule>这是我的.htaccess代码。我已经在主页/test.php中创建了新文件,当我从浏览器访问它时,它给出了访问错误,
i have tried by replacing index.php with test.php but it still not working。
有人能给我解释一下这个代码是如何工作的吗?为什么我的代码不能工作。
i have deleted .htaccess but its still not working. What else file it can be.发布于 2012-04-25 06:17:48
变化
RewriteRule . /homepage/index.php [L]至:
RewriteRule (.+) /homepage/index.php?page=$1 [L]附注:为了让它起作用,你的index.php需要监听$_GET‘页面’并加载适当的资源。
编辑:如果不使用"?page=$1“,您的代码将只显示除文件或目录以外的所有请求的索引页。我不确定这是不是你想要的。
https://stackoverflow.com/questions/10303692
复制相似问题