Welcome Guest, Not a member yet? Register   Sign In
CI -index.php?
#11

[eluser]Yan Heinz[/eluser]
Thank you very much!
#12

[eluser]unsub[/eluser]
I know this is a tired old subject for the experts, and I'm sorry... I'm a little over my head, I'm a media designer/programmer more than a web tech.
Anyway, when I do the above (hoping to fix an issue with pagination number being taken as controller names by CI... ) all my styling and images dissappear. While my site is semantically correct and still works, I would prefer to have styling and images. Smile hehe

so... I don't even know enough about what is going on to know what question to ask. Does anyone have any pointers on where I start looking for a solution to this?

Thanks all, this is one of the most helpful and friendly forums I have been on.

-gabriel
#13

[eluser]Dam1an[/eluser]
An educated guess would be the relationship to you're css/images
You need to give it the absolute path to css using base_url() like so

Code:
<link rel="stylesheet" href="<?=base_url()?>css/reset.css" media="screen" type="text/css" />

That function is in the URL helper, so be sure to autoload that
#14

[eluser]unsub[/eluser]
ah, I wish...
here's what's being rendered:
Code:
<link rel="stylesheet" type="text/css" href="http://www.unsub.ca/system/assets/css/3col_fullheight.css" />
...which is correct.
I wrote a simple assets class myself which is using urls set in the config file.
Code:
//$config['base_url'] = "http://localhost/unsub_inc/";
$config['base_url']="http://www.unsub.ca/";

/*
* Assets Folder Location
*
* url to the assets folder (~/system/assets/) which contains
* css, libraries, etc. Maybe it will work, but probably not... :(
*/
$config['unsub_asset_folder']       = $config['base_url'].'system/assets/';
$config['unsub_images']             = $config['unsub_asset_folder'].'images/';
$config['css_path']                 = $config['unsub_asset_folder'].'css/';
$config['js_path']                     = $config['unsub_asset_folder'].'tools/javascript/';
/*
...and used in the controllers like so:
Code:
$data['header_data']['headers'] = array(
   $this->assets->load_css("3col_fullheight.css","css"),            
   $this->assets->load_css("ui.all.css","tools/javascript/jquery/themes/ui-darkness"),
   $this->assets->load_js("jquery-1.3.2.min.js","jquery"),
   $this->assets->load_js("ui.core.js","jquery/ui"),
   $this->assets->load_js("ui.accordion.js","jquery/ui"),
   $this->assets->load_js("tickerSlide.js"),
   $this->assets->load_js("bgiframe.js","jquery/external/bgiframe")
);
So the weird thing is that it's getting the locations of all my css and js files correct, and yet they still aren't working.

I am starting to think that this is yet another htaccess issue from a newbie Tongue

Would you mind if I posted it, and you could maybe point out any glaring errors?
#15

[eluser]unsub[/eluser]
hi
I'm just going to post my .htaccess file in hopes that someone can tell me if I've made an obvious error - these files baffle me, I'm afraid...

Code:
# -FrontPage-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Files .htaccess>
order allow,deny
deny from all
</Files>

<Limit GET HEAD POST>
order allow,deny
--here's where I have all the stuff I want to block, fuspy, etc., and some ips
allow from all
</LIMIT>

<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>

AuthName www.unsub.ca
AuthUserFile /home/unsub/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/unsub/public_html/_vti_pvt/service.grp

<Files 403.shtml>
order allow,deny
allow from all
</Files>

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ http://www.unsub.ca [R,NC]

so, the last rule, just above here, I think was put there by my CPanel settings, and the AuthName etc., i don't know... that was there already. What I have added is just the last bit, aside from the last rule like I mentioned.
I could sure use a little guidance. I'm slowly getting the hang of .htaccess, but I have yet to get the 'aha' moment where it starts to make real sense to me.

Thanks for any help I can get.
cheers
#16

[eluser]Dam1an[/eluser]
Daniel is our resident htaccess expert, but I'll give it a go anyway
I think you need to add css to the rewrite condition

Code:
// From this
RewriteCond $1 !^(index\.php|images|robots\.txt)
// to this
RewriteCond $1 !^(index\.php|images|robots\.txt|css)


Without that, I think it would try to route any css files through the index.php file
#17

[eluser]dijon[/eluser]
Code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

Basically, if the requested file is not an actual file or directory, it replaces with /index.php/

This works a lot better for me than manually specifying css, etc. etc.
#18

[eluser]Dam1an[/eluser]
I seem to have both in mine
Code:
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico|license.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]

And that was given to me by the Guru, and has never failed me yet
#19

[eluser]dijon[/eluser]
any idea what the [L, QSA] does for you rather than the [L] in mine?
#20

[eluser]Dam1an[/eluser]
Taken from here
Quote:[QSA] = Query String Append, should be used to prevent all redirects from going to your default controller, which happens on some server configurations.




Theme © iAndrew 2016 - Forum software by © MyBB