Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter with cPanel. mod_rewrite problem
#1

[eluser]Unknown[/eluser]
Hey guys,

So I'm new to this cPanel stuff, my friend just hired me to program simple PHP so I decided to use CodeIgniter (which I'm very familiar with, especially on how the routing works). I tried uploading the CodeIgniter to the cPanel and weird thing is... my .htaccess doesn't work.

Here's what's inside my .htaccess:
Code:
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond $1 !^(index\.php|images|js|scripts|dompdf|uploads|robots\.txt|css)
    RewriteRule ^(.*)$ ./index.php/$1 [L]
</IfModule>

I followed the user guide located here : http://codeigniter.com/wiki/mod_rewrite/

And my only problem is, I don't know how to do steps 3 & 4 on the stated link above. Can anyone help me out? :O I'm a total noob when it comes to things like this Sad Or maybe there's something wrong with my .htaccess file?
#2

[eluser]Increazon[/eluser]
Thanks thisleenoble. I had this problem now, on cPanel its failing. I will try your solution soon.
My website
#3

[eluser]InsiteFX[/eluser]
The easiest way to test a .htaccess file is to just place a string of text in it if its working you will get a server 500 Error
#4

[eluser]Increazon[/eluser]
Its always working. But on cPanel hosting CodeIgniter gives index page every time when $config['uri_protocol'] = 'PATH_INFO'; Now i just opened new cPanel hosting with $config['uri_protocol'] = 'ORIG_PATH_INFO'; and its working. My htaccess:
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|_|tv|temp|pics|big_pics|images|files|config|system|sitemap\.xml|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

I had tried a lot of hostings, and was thinking their mod_rewrite broken...
But now i will start my first website in USA in english!
#5

[eluser]InsiteFX[/eluser]
Try:
Code:
$config['uri_protocol'] = 'REQUEST_URI';
#6

[eluser]weboap[/eluser]
if it will help somebody, for some hostings the base is not always
RewriteBase /

you may want to check with your hosting to see if you have to add to your .htaccess

RewriteBase /~username/

after the RewriteEngine on




Theme © iAndrew 2016 - Forum software by © MyBB