Welcome Guest, Not a member yet? Register   Sign In
short url's and mod_rewrite
#1

[eluser]phpknight[/eluser]
Hi guys,
I just downloaded and start exploring ci and I'm stuck with this short url's.
on this forum I've founded http://ellislab.com/forums/viewthread/127923/ similar problem.
In my .htaccess file I have
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /mylab/includes/ci/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
</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>
and when I accessing to my helloworld at /mylab/includes/ci/index.php/helloworld everything is ok, but when I try without index.php like this
/mylab/includes/ci/helloworld I've got 404 error page. I suppose that mod_rewrite is not installed. I'm on shared server.
regards,
#2

[eluser]jedd[/eluser]
Hi phpknight and welcome to the CI forums.

[quote author="phpknight" date="1262525492"]
I suppose that mod_rewrite is not installed. I'm on shared server.
[/quote]

A phpinfo page will answer this question very quickly for you.
#3

[eluser]phpknight[/eluser]
thanks for reply.
mod_rewrite is already enabled but I still expirience this error.
Any suggestions ?
#4

[eluser]keld[/eluser]
Maybe you have a problem in your path on this line:
RewriteBase /mylab/includes/ci/

I made my htaccess without this line
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

and it works.
#5

[eluser]phpknight[/eluser]
hi summerstudent,
I need that path cause my ci installation is at that path.
I tried also your htaccess file, but with this I got only 500 sever error.
with my solution I still have this 404 error message, and I know ci installation is ok cause that 404 error is from code igniter, not default one. I also check my config.php for base_url and index_page='index.php' and rewrite_short_tags is set to true.
Realy frustrated.
what I assumed to last a very short time, tuned out to be a big problem.
#6

[eluser]phpknight[/eluser]
just to mention that I tried all this time with htaccess file at the root of webserver instead of root ci installation folder, and I'm success with code that summer student recommend me, one more time for everyone who needs this.
put this on the root of ci installation folder
-------------------
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
-------------------
#7

[eluser]keld[/eluser]
I'd say you issue is coming from your httpd.conf (apache file). Make sure you have rewrite_mod extension activated in your file.
You'll also need to modify a few things in it as I had the same problems as yours. I followed the instructions from this site and it worked:
http://codeigniterandjquery.blogspot.com...exphp.html




Theme © iAndrew 2016 - Forum software by © MyBB