EllisLab text mark
Advanced Search
     
remove index.php from url
Posted: 26 April 2010 05:12 AM
Joined: 2010-03-22
26 posts

i have ci 1.7.2
and i have taken my application folder outside the system folder.
can anyone provide me the .htaccess code to remove the index.php from url.
previously(upto earlier today) i was using this code

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

and it worked fine but now i dont know what i did wrong it says server:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log

can anyone provide me the working htaccess code,
thank you

 
Posted: 26 April 2010 05:13 AM   [ # 1 ]   [ Rating: 0 ]
Joined: 2010-03-22
26 posts

i have removed index from the config file BTW

 
Posted: 26 April 2010 05:20 AM   [ # 2 ]   [ Rating: 0 ]
Joined: 2010-03-22
26 posts

the code from ci wiki doesnot work either

 
Posted: 26 April 2010 05:30 AM   [ # 3 ]   [ Rating: 0 ]
Joined: 2008-10-21
643 posts

I would think that this code is not going to work because this rule will call itself again.
If you call /controller/method, it will be translated to /goshali/index.php/controller/method.
But that will again be translated to /goshali/index.php/controller/method/controller/method.
Etc.

You should check in your rewrite rule if the address has not already been rewritten.
You could add RewriteCond %{REQUEST_URI} !goshali/index\.php to your rule.
This will check if the address has already been rewritten, so it doesn’t go on rewriting.

 
Posted: 26 April 2010 05:49 AM   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2008-07-16
664 posts

And if you get “Internal Server Error”, do as the information says: check the server error log.

 
Posted: 28 April 2010 04:48 AM   [ # 5 ]   [ Rating: 0 ]
Joined: 2010-03-22
26 posts

ok i have fixed the problem

 
Posted: 28 April 2010 05:47 AM   [ # 6 ]   [ Rating: 0 ]
Joined: 2010-04-25
5 posts

Can you post what you did to fix it?

 
Posted: 28 April 2010 06:29 AM   [ # 7 ]   [ Rating: 0 ]
Joined: 2010-04-22
4 posts

me,too.please!

 
Posted: 29 April 2010 06:10 AM   [ # 8 ]   [ Rating: 0 ]
Joined: 2008-04-19
1153 posts

Marvin_S, 391, maybe you should post your own problem in your own threads with more information regarding your specific problem?

 Signature 

Thorpe Obazee

 
Posted: 30 April 2010 01:35 AM   [ # 9 ]   [ Rating: 0 ]
Avatar
Joined: 2009-06-19
6707 posts

You know I must see this same Question asked 100 times a week on these forums
Unreal…

Search is your friend….....

InsiteFX

 Signature 

Certified State of CT Computer Programming Teacher.
Custom Designed Icons, eBook Covers Software Boxes. CD, DVD Etc. New iPhone® Tab Bar Icons and iPhone® Applications Icons.

Skype: insitfx

STOP! Before posting your questions, remember the WWW Golden rule:
What did you try? What did you get? What did you expect to get?

Input -> Controller | Processing -> Model | Output -> View

 
Posted: 04 May 2010 03:50 AM   [ # 10 ]   [ Rating: 0 ]
Joined: 2010-03-22
26 posts

here’s the .htaccess code i used to remove the index.php from url

in localhost/wamp:

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

in server:

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

ofcourse mod)_rewrite should b running in server

 
Posted: 19 May 2010 06:12 AM   [ # 11 ]   [ Rating: 0 ]
Joined: 2010-05-19
1 posts

i don’t recomment to remove index.html because it’s likely lovable from the search engins for quick indexing