当我的网站第一次打开时,它直接进入这个地址:http ://www.website.com/tr/main
但我希望我的链接是这样的:http ://www.website.com/ 我无法删除“tr/main”链接。我怎么解决这个问题?
php代码:
$route['default_controller'] = "main";
$route['404_override'] = '';
$route['(tr|en)/(.+)$'] = '$2';
$route['(tr|en)$'] = $route['default_controller'];
访问代码:
RewriteEngine On
# Put your installation directory here:
# If your URL is www.example.com/, use /
# If your URL is www.example.com/site_folder/, use /site_folder/
RewriteBase /
# Do not enable rewriting for files or directories that exist
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# For reuests that are not actual files or directories,
# Rewrite to index.php/URL
RewriteRule ^(.*)$ index.php/$1 [PT,L]