Welcome Guest, Not a member yet? Register   Sign In
Getting rid of having to use index.php in the URL
#1

[eluser]Doug Lerner[/eluser]
Right now the URL to a controller in my application folder (after moving the system folder to the site root) is:

http://mydomain.com/CI/app1/index.php/welcome

This works, and loads the view for the default welcome controller that comes with CI.

I want to get rid of the index.php from the URL though. The docs say to make an .htaccess file with the following in it:

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

I did that and added it to the app1 folder, but it didn't seem to have any affect. I still need the index.php in the URL or I get a page not found error.

Am I putting the .htaccess file in the wrong place? Or do I need to set permissions for that file? Or....?

I have a .htaccess file inside public_html already and didn't want to mess with that one. I thought that I could have a separate one in in app1 folder itself to deal with rewrite in that hierarchy. No?

Thanks for any suggestions,

doug
#2

[eluser]Pascal Kriete[/eluser]
The doc .htaccess really needs to change. The problem is in the RewriteRule:
Code:
RewriteRule ^(.*)$ /CI/app1/index.php/$1 [L]

# Or simply
RewriteRule ^(.*)$ index.php/$1 [L]
#3

[eluser]Doug Lerner[/eluser]
Thanks. I tried the latter, more general one you suggested and it worked.

doug@I do sleep, but it is the afternoon here




Theme © iAndrew 2016 - Forum software by © MyBB