简体   繁体   English

在codeigniter中重写URL

[英]url rewriting in codeigniter

I was using this 我在用这个

RewriteEngine On
RewriteBase /
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

#RewriteRule ^(.*)$ /jukson/index.php/$1 [L,QSA]

to remove index.php from codeigniter url in my wamp. 从我的wamp中的codeigniter网址中删除index.php。

but I have now installed windows 8 dev. 但是我现在已经安装了Windows 8 dev。 preview and wamp does not run very well in this OS. 在此操作系统中,预览和漫游功能无法很好地运行。 So i have installed apache, mysql, php manually. 所以我已经手动安装了apache,mysql,php。 All is well except that above code doesn't remove "index.php" from url and without index.php the page does not open. 一切都很好,除了上面的代码不会从url中删除“ index.php”并且没有index.php的情况下,该页面也无法打开。

First of all remove the duplicated line RewriteEngine On - leave only the first one. 首先,删除重复的行RewriteEngine On仅保留第一行。 Also, although your pages should not load at all if mod rewrite would be disabled (you should get an error 500 page having this .htaccess ), try checking if it is enabled. 此外,尽管如果禁用了mod rewrite,尽管页面根本不会加载(您应该得到一个带有此.htaccess的错误500页面),但是请尝试检查是否启用了该页面。 My advice is that is always a good idea to check the error log. 我的建议是检查错误日志始终是一个好主意。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM