这不是mod_rewrite的问题,而是我的问题。我很确定我的错误是非常愚蠢的,但我无法解决它。 我在Mac OS X Lion上设置了一个非常简单的XAMPP安装,它有一个简单的index.php脚本,它什么都不做。我只是想了解如何在PHP中使用友好的URL,所以,如果我用这个格式接收的URLapache中的mod_rewrite问题
http://localhost/project/controller_name/action_name/id
所以,如果我收到这
http://localhost/project/user/delete/7
可以使用内部像这
http://localhost/project/index.php?controller=user&action=delete&id=7
我创建的项目文件夹.httacess与此内容
RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)/([^/]*)$ /aletta/index.php?controller=$1&action=$2&id=$3 [L]
我检查了是否启用了mode_rewrite并且它是。但不起作用。我输入 http://localhost/project/user/delete/7
,页面显示“找不到对象!”
任何帮助将大大appreaciate
你是什么DOCUMENT_ROOT和你在哪里以上述规则放置.htaccess? – anubhava 2013-04-10 05:31:53