Welcome Guest, Not a member yet? Register   Sign In
Newbie's stupid routing problem
#1

[eluser]pernavoi[/eluser]
I have CI system folder in public_html root folder.
I have .htaccess copied from CI user guide
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
I have set base_url in config.php to "http://www.mydoiman.com/"
I can't access anything from public_html root directory with direct address
for example trying to access http://www.mydoiman.com/test.txt gives CI's 404 error page. (And yes that file exists in public_html folder).
This must be some config error somewhere but where?

I am trying to load my CSS-files from mydoiman.com/css/ -directory but can't access them. Have tried also with url helper <?=base_url()?>


EDIT: Solved this with few changes to .htaccess
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|system|images|css|js)
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteRule ^(images|css|js)/(.*) /system/application/views/$1/$2 [L]
Now I can access css, image and js -files with following urls:
/css/style.css
/images/image.jpg
/js/

And those folders are located under /system/application/views/
#2

[eluser]vitoco[/eluser]
this one works for me
Code:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

Saludos




Theme © iAndrew 2016 - Forum software by © MyBB