0

I want to remove index.php from url in codeigniter . So in user guide, there is way to do it by editing .htaccess.But my host do not allow to edit it. Is there any way to do with codeigniter's code? Thanks.

1
  • 2
    Sorry, but if you cannot do a URL re-write via .htaccess file then it's pretty much impossible. Commented Jun 15, 2012 at 14:12

3 Answers 3

1

Sorry, I'm afraid it's not possible. CodeIgniter (or browsers in general, for that matter) need an index file, by editing the .htaccess file you tell the browser not to show the 'index.php' part, but it's still there. Removing the index.php file itself is silly since your website won't work without it.

Sign up to request clarification or add additional context in comments.

Comments

1

put the following code in .htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]  

<Files "index.php">
AcceptPathInfo On
</Files>

and put $config['index_page'] = ''; in config file instead of $config['index_page'] = ''; put the .htaccess near to index.php out of system and application folders

Comments

-1

I dont think there is a way to do it without editing the htaccess file.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.