[英].htaccess not working with IP address in codeigniter
我正在使用Codeigniter 3.1.2。我的網址看起來像http://20.186.5.144/myproject/controller
夾路徑是var / www / html / myProject /
問題是沒有從路由中刪除index.php
。
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]`
以上是.htaccess
配置。 我究竟做錯了什么?
/*
|--------------------------------------------------------------------------
| Base Site URL
|--------------------------------------------------------------------------
|
| URL to your CodeIgniter root. Typically this will be your base URL,
| WITH a trailing slash:
|
| http://example.com/
|
| WARNING: You MUST set this value!
|
| If it is not set, then CodeIgniter will try guess the protocol and path
| your installation, but due to security concerns the hostname will be set
| to $_SERVER['SERVER_ADDR'] if available, or localhost otherwise.
| The auto-detection mechanism exists only for convenience during
| development and MUST NOT be used in production!
|
| If you need to allow multiple domains, remember that this file is still
| a PHP script and you can easily do that on your own.
|
*/
$config['base_url'] = 'http://localhost/myproject/';
在實時域上時,請勿將其更改為您的域示例:
$config['base_url'] = 'http://www.example.com/';
如果未設置,則在嘗試加載CSS和圖像等時會遇到一些鏈接錯誤。
更多htaccess https://github.com/wolfgang1983/htaccess_for_codeigniter
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.