• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
404 error when using rewrite engine

#1
[eluser]walrus_lt[/eluser]
Hello, i am getting an 404 error when using rewrite engine when i am accessing, http://localhost/projects/ but when trying access http://localhost/projects/welcome/ then everything works fine. What's the problem? Sad

Code:
<IfModule mod_rewrite.c>
    DirectoryIndex index.php
    RewriteEngine on
    RewriteCond $1 !^(index\.php|google254b42e34114b586\.html)
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]
</IfModule>

<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>

#2
[eluser]walrus_lt[/eluser]
Here is debug info :/

Code:
DEBUG - 2008-12-16 08:47:27 --&gt; Config Class Initialized
DEBUG - 2008-12-16 08:47:27 --&gt; Hooks Class Initialized
DEBUG - 2008-12-16 08:47:27 --&gt; URI Class Initialized
ERROR - 2008-12-16 08:47:27 --&gt; 404 Page Not Found --&gt; artgallery

#3
[eluser]PowerCode[/eluser]
I'm assuming that, as you've written, you have your CI application inside a folder named projects.

This one works fine for me, should do the same even with you.

Code:
RewriteEngine On
RewriteBase /projects
RewriteCond %{REQUEST_FILENAME} !-s
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

You don't need to explicitly specify file names to exclude from rewriting. The URL will not be re-written if the requested folder/file already exists on the system

#4
[eluser]walrus_lt[/eluser]
Thanks Big Grin


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.