Incase you are experiencing 404 error after uploading your codeigniter files on your shared host like Namecheap, GoDaddy, GreenGeeks e.t.c, add the code below in your Htaccess file and you should be good to go.
| # !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading |
| # If your page resides at |
| # http://www.example.com/mypage/test1 |
| # RewriteBase /mypage/test1/ |
| RewriteCond %{REQUEST_FILENAME} !-f |
| RewriteCond %{REQUEST_FILENAME} !-d |
| RewriteRule ^(.*)$ index.php?/$1 [L] |
| <IfModule !mod_rewrite.c> |
| # If we don't have mod_rewrite installed, all 404's |
| # can be sent to index.php, and everything works as normal. |
| # Submitted by: ElliotHaughin |
| ErrorDocument 404 /index.php |
</IfModule>
If above code doesn't work for you, you can see source here:
https://gist.github.com/philipptempel/4226750
No comments:
Post a Comment