首先,确定是开启了mod_rewrite......
工程名是find,服务器地址在D:\wamp\www
根目录下的.htaccess是这样的:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /find/index.php/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /find/index.php
</IfModule>
这样就可以去掉index.php
问题是我怎么建立虚拟主机?
httpd.conf中式这样的:
<VirtualHost 127.0.0.8>
ServerName find.cc
DocumentRoot D:\wamp\www\find
</VirtualHost>
hosts中设置:
127.0.0.8 find.cc
在浏览器中输入:find.cc.结果报500错误:
Internal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log.
查看了错误日志:
[error] [client 127.0.0.8] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
请问怎么建立虚拟主机? |