Setting up .htaccess |
[eluser]RockerBoy402[/eluser]
Okay, I'm trying to access my stylesheets, but I'm having a problem. Here is my folder layout: -/var/www/ --/application --/system --/public_html ----/css ------style.css ----.htaccess ----index.php As you can see my application and system folders exist outside the site root. If I go to http://mydomain.com/css/style.css I get a 404 Error. I know I need to set up .htaccess, but I'm not quite sure how. None of the examples/instructions I could find online were geared toward this setup. Would someone be able to help me out with the proper .htaccess Mod_Rewrite rules? Also, my config.php file still has $config['index.php'] set to index.php...Some of the tutorials I found said I should set that to an empty string. If I need to do that, please let me know. Thanks in advanced guys! ~RB
[eluser]steelaz[/eluser]
Try temporary removing .htaccess file. When it's removed, does 404 error go away? Post your .htaccess file contents.
[eluser]RockerBoy402[/eluser]
My .htaccess file is empty. I've also tried adding in: RewriteEngine on RewriteCond $1 !^(index\.php|images|css|robots\.txt) RewriteRule ^(.*)$ /index.php/$1 [L] That didn't help the problem, though. Not sure what to try at this point. The 404 Error I'm getting is a CI error and not the typical Apache 404 error.
[eluser]RockerBoy402[/eluser]
Thank you Kindari on IRC for the solution: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php/$1 [L] RewriteCond %{REQUEST_URI} ^application.* RewriteRule ^(.*)$ /index.php/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> <IfModule !mod_rewrite.c> ErrorDocument 404 index.php </IfModule>
[eluser]InsiteFX[/eluser]
in your index.php file: Code: /** One of those should work for you. InsiteFX |
Welcome Guest, Not a member yet? Register Sign In |