<IfModule mod_rewrite.c>
RewriteEngine on#如果目录存在就直接访问目录不进行RewriteRule
RewriteCond %{REQUEST_FILENAME} !-d
#如果文件存在,就直接访问文件,不进行下面的RewriteRule.(不是文件或文件不存在就执行重写)
RewriteCond %{REQUEST_FILENAME} !-f
#所有找不着实际路径的文件,统一交给index.php处理
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
TP 自己就带有 .htaccess你看看这里 http://blog.csdn.net/qq1355541448/article/details/21375407
RewriteEngine on#如果目录存在就直接访问目录不进行RewriteRule
RewriteCond %{REQUEST_FILENAME} !-d
#如果文件存在,就直接访问文件,不进行下面的RewriteRule.(不是文件或文件不存在就执行重写)
RewriteCond %{REQUEST_FILENAME} !-f
#所有找不着实际路径的文件,统一交给index.php处理
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
TP 自己就带有 .htaccess你看看这里 http://blog.csdn.net/qq1355541448/article/details/21375407
我按照这个BLOG的地址设置了,也就是大概意思是 httpd.conf里面要单独设置,比如一个网站
<VirtualHost *:80>
LoadModule rewrite_module modules/mod_rewrite.so //我写在这里了,
ServerAdmin [email protected]
DocumentRoot /web/xx.com
ServerName xx.com
ErrorLog logs/errun-error_log
CustomLog logs/acrun-access_log common
</VirtualHost>单独一个网站就需要单独开启一个模块吗,不能全局配置吗,我按照这样的修改以后在重新启动httpd.启动是可以,但是报了一个错误
然后问题依旧~
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
</body></html>
我找到原因了,是默认创建.htaccess的时候权限问题,因为我是root登录的,所以创建这个文件的权限是ROOT,我有把它设置成
777的权限,但还是一样,刚才我试着修改成此网站的用户组和用户,然后刷新就可以了。
谢谢徐版,