Welcome Guest, Not a member yet? Register   Sign In
remove index.php problem


I got a problem with removing the index.php in the path.

1. Here is the link:
I got that error, with the .htaccess file in the root(/public_html), with the codeigniter files and everything!
the htaccess:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

2. I also tried it on my xampp - apache server!
There I got the .htaccess file in htdocs/cms (htdocs/cms/.htaccess)
So there I got this "code":
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /cms/index.php/$1 [L]
But I don't now why there would be /cms/index.php when the htaccess is in the same directory...
Btw, it works a little bit, I don't need to write index.php, BUT there is no design, the design is gone, I suppose that it is the path's which is wrong.
How can I solve these 2 problems?

Thanks //WebbHelp

[eluser]Ben Edmunds[/eluser]
Do you have mod_rewrite enabled?

Is the base_url in your config.php file correct?

Yes, I am pretty sure it is enabled and the base_url path is, where I got the files, in the "ftp"-page I got it into the root: http://www.nkpg-stad.se/

In my htdocs - apache server, the pathi so to /cms, because I got the files in there!

[eluser]Colin Williams[/eluser]

?? :S


You need to exclude css images etc from the rewrite .
something like this .

RewriteCond $1 !^(index\.php|images|css|js|uploads|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]


[eluser]Ben Edmunds[/eluser]
Here's a sample htaccess you can use. Make sure the change the names as applicable.

RewriteCond $1 !^(index\.php|(.*)\.swf|images|css|downloads|js|robots\.txt|favicon\.ico|sitemap\.xml)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]

Theme © iAndrew 2016 - Forum software by © MyBB