Welcome Guest, Not a member yet? Register   Sign In
Simply can't get .htacces to work..
#1

[eluser]Buch[/eluser]
Heya,

I've been trying every .htacces example availible on the forums and tried them all but still I can't get my images to work but my css on the other hand works rather fine (some small problem with body).

My build.
Code:
- Ci Folder
   - system
       - application and all that.
   - assets
       - images
       - css
       - js
When linking from within a view file I use
/assets/images/imagehere.png

And exactly the same with my Css but my css work partially when linking this way.
/assets/css/stylehere.css

The current .htaccess file I ended up with so my http://ci.mysite.com/ works without errors displaying is -->

Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

But I really don't get why this should be such a big problem I just want it to work Sad
And I don't want to end up hard coding all the links :/


Best Regards
Kasper
#2

[eluser]Spiked[/eluser]
Use something like this:

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|assets)
RewriteRule ^(.*)$ /index.php/$1 [L]
#3

[eluser]Buch[/eluser]
Hmm works now but then I got following errors

Severity: Notice
Message: Undefined offset: 0
Filename: libraries/Router.php
Line Number: 190
Line Number: 196
Line Number: 199

And when looking at theese lines I find nothing special Sad
Its just the original one.
#4

[eluser]thesf[/eluser]
Having those exact same errors Buch. Any luck resolving this?

EDIT: managed to get it working properly with no errors by using "Solution 2" from http://codeigniter.com/wiki/Dreamhost_.htaccess/
#5

[eluser]Buch[/eluser]
Ahhh great nice thanks Smile
#6

[eluser]Unknown[/eluser]
Hi, I also had the problem of index.php on local server but being required on real-world hosting. "Solution 2" worked flawlessly. Thanks thesf!
#7

[eluser]spidy[/eluser]
I am having htaccess problem too. I tried all the tutorial from codeingiter nothing is work.
I am running apache2 in ubuntu 10.04. the rewrite mode is already enabled.
Here is the url that I test.
------works---------
http://192.168.1.1/
http://192.168.1.1/index.php
http://192.168.1.1/index.php/blog
http://192.168.1.1/index.php/blog/comment

------Fail to work-------
http://192.168.1.1/blog
http://192.168.1.1/blog/comment

error that I get is error 404 page not found
the default error 404 from browser not from codeigniter

Greatly appreciate your help.




Theme © iAndrew 2016 - Forum software by © MyBB