Php 在localhost中处理网站时,我的htaccess被忽略
我已经将一个网站导入到我的本地主机,主页打开得很好,但是链接指向404,我正在使用codeigniter,它使用htaccess跳过index.php加载它的控制器,我相信获得这些404的原因是跳过htaccess 多谢各位 访问代码:Php 在localhost中处理网站时,我的htaccess被忽略,php,apache,.htaccess,codeigniter,localhost,Php,Apache,.htaccess,Codeigniter,Localhost,我已经将一个网站导入到我的本地主机,主页打开得很好,但是链接指向404,我正在使用codeigniter,它使用htaccess跳过index.php加载它的控制器,我相信获得这些404的原因是跳过htaccess 多谢各位 访问代码: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !^(index\.php|public|images|robots\.txt|css|
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|public|images|robots\.txt|css|swf)
RewriteRule ^(.*)$ index.php/$1 [L]
虚拟主机代码:
DocumentRoot /var/www/mysite.com/public_html
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/mysite.com/public_html/>
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
#AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
DocumentRoot/var/www/mysite.com/public\u html
选项如下符号链接
不允许超限
不允许超限
命令允许,拒绝
通融
ScriptAlias/cgi-bin//usr/lib/cgi-bin/
#不允许超限
选项+执行CGI-多视图+符号链接所有者匹配
命令允许,拒绝
通融
ErrorLog${APACHE_LOG_DIR}/error.LOG
#可能的值包括:调试、信息、通知、警告、错误、临界值、,
#警惕,埃默格。
日志级别警告
CustomLog${APACHE\u LOG\u DIR}/access.LOG组合
将网站目录的AllowOverride None
更改为AllowOverride All
:
<Directory /var/www/mysite.com/public_html/>
AllowOverride All
Order allow,deny
allow from all
</Directory>
允许超越所有
命令允许,拒绝
通融
如果没有,.htaccess将不被处理:如果需要答案,请显示代码:)您正在运行Apache还是IIS?