我正在为一家公司更新一个项目。我将文件传输到我的本地主机。所以项目在“localhost/project/”中。当我在浏览器中打开网站时,所有链接都指向“localhost/filename”,目录从项目文件夹向上一级。我做了一些研究,注意到有人建议更改 htaccess,但仍然无法得到正确的结果。和建议请让我知道。如果你想要我的任何东西,请问。感谢!
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
开始 :
http://localhost/projectfolder/
<a href="/" title="">Home</a>
导致 :
http://localhost/
配置文件:
$config['base_url'] = 'http://localhost/projectfolder/';
$config['index_page'] = "";
$config['uri_protocol'] = "AUTO";
$config['url_suffix'] = ".html";
$config['language'] = "english";
$config['charset'] = "UTF-8";
$config['enable_hooks'] = FALSE;
$config['subclass_prefix'] = 'MY_';
$config['permitted_uri_chars'] = 'a-z & + 0-9~%.:_\-,\'?';
$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['log_threshold'] = 0;
$config['log_path'] = '';
$config['log_date_format'] = 'Y-m-d H:i:s';
$config['cache_path'] = '';
$config['encryption_key'] = "";
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_encrypt_cookie'] = FALSE;
$config['sess_use_database'] = FALSE;
$config['sess_table_name'] = 'ci_sessions';
$config['sess_match_ip'] = FALSE;
$config['sess_match_useragent'] = TRUE;
$config['sess_time_to_update'] = 300;
$config['cookie_prefix'] = "";
$config['cookie_domain'] = "";
$config['cookie_path'] = "/";
$config['global_xss_filtering'] = FALSE;
$config['compress_output'] = FALSE;
$config['time_reference'] = 'local';
$config['rewrite_short_tags'] = FALSE;
$config['proxy_ips'] = '';