最近我在我的系统上安装了ubuntu12.10。安装了Apache2.0、php、mysql等。还通过"sudo a2enmod重写“启用url重写。还编辑了配置文件,将AllowOverride none更改为AllowOverride All。
这是我的.htaccess文件
RewriteEngine On # Turn on the rewriting engine^M
RewriteRule ^blog?$ blog.php?p=$1 [NC,L]
RewriteRule ^blog/([a-z0-9A-Z]+)/?$ blog.php?p=$1 [NC,L]
RewriteRule ^appstore?$ appstore.php [NC,L]
RewriteRule ^appstore/([a-z0-9A-Z\--]+)/?$
RewriteRule ^([a-z]+)/?$ index.php?p=$1 [NC,L]
Now ideally, site-url/blog should display the result of blog.php,
site-url/appstore should display the result of appstore.phprest都应该显示index.php的结果。但我没有得到想要的结果。有什么问题吗?
P.S :早些时候,我在windows 7 Xampp服务器上测试我的应用程序,它运行得很好。它还能很好地工作在我安装了ubuntu12.04的亚马逊ec2实例上。
发布于 2014-03-10 18:57:39
您可能已经启用了MultiViews选项。使用根.htaccess顶部的这一行禁用它:
Options -MultiViewshttps://stackoverflow.com/questions/22308869
复制相似问题