Jas*_*yer 4 php apache .htaccess mod-rewrite codeigniter
我在让 mod_rewrite 与 CodeIgniter 一起工作时遇到问题。我正在运行 apache 2.4。
我的网站根目录是 /Users/Jason/Development/www
这是我目前在 .htaccess 文件中的代码,该文件与我的主 index.php 文件位于同一目录中。
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /myapp/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?我不断收到一个 404 页面,说在此服务器上找不到请求的 URL。
小智 5
Options -Indexes +FollowSymLinks
RewriteEngine On
RewriteBase /
# exclude any paths that are not codeigniter-app related
RewriteCond %{REQUEST_URI} !^/server-status
RewriteCond %{REQUEST_URI} !^/server-info
RewriteCond %{REQUEST_URI} !^/docs
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
<IfModule mod_php5.c>
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
# the following is for rewritting under FastCGI
<IfModule !mod_php5.c>
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2345 次 |
| 最近记录: |