.htaccess redirect problem in codeigniter 2.1.2 |
[eluser]Pak_student[/eluser]
hi iam beginner in Codeigniter Framework I have a problem when i post the page to home page and i am using wamp step1: when i run from localhost "http://localhost:100/" step2: page sucefully load`enter code here` "http://localhost:100/CodeIgnite/" setp3:but when i post this page to home "http://localhost:100/CodeIgnite/login/process" error generate Not Found The requested URL /CodeIgnite/login/process was not found on this server. but when i edit the url like "http://localhost:100/CodeIgnite/index.php/login/process" page is sucessfully post i create .htaccess file in root folder <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /CodeIgnite `RewriteCond` %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !^(index\.php|images|robots\.txt|css) RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> $config['base_url'] = "http://localhost:100/CodeIgnite" $config['index_page'] = " " $config['uri_protocol'] = "AUTO" #LoadModule rewrite_module modules/mod_rewrite.so enable it by removing # i try level my best but i can't resolve it can any one help me
[eluser]Lotus[/eluser]
you need a rewrite base rule Code: RewriteBase /CodeIgniter http://httpd.apache.org/docs/2.2/mod/mod...ewritebase
[eluser]CroNiX[/eluser]
He has one, but I believe it should end in a slash as well: /CodeIgnite/ Also, notice that your rewrite module is named "mod_rewrite.so", not "mod_rewrite.c" like your if block is checking for in the htaccess. So that whole block probably isn't being read at all. There are also tick marks (``) around one of the RewriteCond statements. Try this...I removed unnecessary parts Code: <IfModule mod_rewrite.so>
[eluser]Pak_student[/eluser]
Thanks for reply,but still there is 404 not found error occur same problem as i explain above......
[eluser]Daniel Moore[/eluser]
Try using the instructions found in my signature at the link titled, "Using .htaccess to remove index.php". It is pretty detailed instructions, and I have yet to encounter a situation where following these instructions properly did not solve the problem, which includes your 404 not found error.
[eluser]wiredesignz[/eluser]
@Pak_student, There is a huge difference between mod_rewrite.c and mod_rewrite.so.
[eluser]Pak_student[/eluser]
but i enable mod_rewrite.so in a appache 2.2.17 and i also use mod_rewrite.so .httacess, still same problem occur... i removed index.php .... http://arifn.web.id/blog/2009/02/06/code...exphp.html
[eluser]Daniel Moore[/eluser]
[quote author="Pak_student" date="1344703360"]but i enable mod_rewrite.so in a appache 2.2.17 and i also use mod_rewrite.so .httacess, still same problem occur... i removed index.php .... http://arifn.web.id/blog/2009/02/06/code...exphp.html[/quote] The bottom of that blog post tells you he was unable to make it work on a Linux box. That's why I gave you a link in my post, telling you where to go for something that will teach you how to make it work whether or not you are on a Windows, Mac, or Linux box. For every situation, for every web host provider, my solution and instructions that I already asked you to read has worked. If you don't want to try it, then I don't want to offer any further insight. However, should you continue to have difficulty in understanding what it is others are trying to tell you to do, and by others I mean people who know what they are talking about (me, wiredesignz, CroNiX), then I'm sure one of us would be happy to log onto your server and fix the problem for you if you give us the appropriate log in information and pay us $2500.00US. I know I'd be happy to do it for that, even though I'm retired and don't need the money, it would take that much to peak my interest any further. http://www.danielwmoore.com/extras/index...pic=7691.0
[eluser]DirtyLogic[/eluser]
in .htacccess Code: <IfModule mod_rewrite.c> in routes set CodeIgnite as the default controller. This would work only if you want CodeIgnite to be your default page loading. Make sure that .htaccess file is located in your root and that you leave the .htaccess file in application alone. I'm sorry if this is unhelpful, but this is merely what I use. If you can find a way to work this this great. Also, make sure in autoload.php you set url and form to autoload in case you need to redirect from forms. Otherwise, you'll get an undefined function warning when trying to redirect (or a flat out server error if DisplayErrors isn't set to On in php.ini). Fix this and set it to Off before moving to production. Like I said, I'm not sure if this will help or not, but it is an alternative that you could potentially use. On a side note, every attempt I've made to modify .htaccess using other suggestions have failed, however that may be because I did not move it to the root folder. I'm not sure. I was exhausted and very frustrated before I bothered to do it this way.
[eluser]InsiteFX[/eluser]
This is the one I use on Windows 7 Pro with XAMPP Code: <IfModule mod_rewrite.c> This will generate a Server 500 Error if the .htaccess file is working. Code: <IfModule mod_rewrite.c> |
Welcome Guest, Not a member yet? Register Sign In |