dongzhi7763
2014-10-23 18:37
浏览 52
已采纳

无法删除codeigniter中重定向到localhost.com的index.php

i have a project having url

http://localhost/myproject/

naw i have a page that is working

http://localhost/myproject/index.php/about

but i want to change it to

http://localhost/mywesites/about

but it's redirecting me to

www.localhost.com/about

my config.php file is

$config['base_url'] = 'http://localhost/myproject/';
$config['index_page'] = '';

and .htaccess file is

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L] 

图片转代码服务由CSDN问答提供 功能建议

我有一个有url的项目

  http://  localhost / myproject / 
   
 
 

naw我有一个正常工作的页面

  http:// localhost / myproject  /index.php/about
nn

但我想将其更改为

  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] 
   
 
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

  • douque2016 2014-10-23 18:42
    最佳回答

    If you use a RewriteBase in your htaccess like this:

    RewriteBase /mywesites/
    

    ...does that work?

    评论
    解决 无用
    打赏 举报
查看更多回答(1条)

相关推荐 更多相似问题