• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hiding Default Controller Name in Codeigniter

#1
[eluser]PhPCoder[/eluser]
When my website opens for the first time , it directly goes to this address: http://www.website.com/tr/main

But I want my link to be like this: http://www.website.com/
I can't remove "tr/main" links. How can I solve this problem?

Php Code:
Code:
$route['default_controller'] = "main";
$route['404_override'] = '';
$route['(tr|en)/(.+)$'] = '$2';
$route['(tr|en)$'] = $route['default_controller'];

Htaccess Code:
Code:
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]


Messages In This Thread
Hiding Default Controller Name in Codeigniter - by El Forum - 06-21-2012, 07:04 AM
Hiding Default Controller Name in Codeigniter - by El Forum - 06-21-2012, 07:38 AM
Hiding Default Controller Name in Codeigniter - by El Forum - 06-21-2012, 07:48 AM
Hiding Default Controller Name in Codeigniter - by El Forum - 06-21-2012, 09:11 AM
Hiding Default Controller Name in Codeigniter - by El Forum - 06-21-2012, 09:59 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.