我有一个有网址的项目
http://localhost/myproject/
naw我有一个正常工作的页面
http://localhost/myproject/index.php/about
但我想将其更改为
http://localhost/mywesites/about
但它正在重定向到
www.localhost.com/about
我的config.php文件是
$config['base_url'] = 'http://localhost/myproject/';
$config['index_page'] = '';
和.htaccess文件是
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
答案 0 :(得分:2)
如果您在htaccess中使用RewriteBase,请执行以下操作:
RewriteBase /mywesites/
......那有用吗?
答案 1 :(得分:0)
使用此代码替换.htaccess文件并尝试:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$1 [PT,L]