URI with Slash |
I have set the base url set to be 'http://domainname/public/'. The links to css and js files are <link href="assets/css/..." rel="stylesheet">. Everything works well until I try to access a page with a slash in it, e.g. 'http://domainname/product/1'. Now the path to the css and js becomes 'http://domainname/product/assets/css/...'. The css and js files can't be found.
Why does this happen?
The current URI: http://domainname/product/1
HTML: <link href="assets/css/..." rel="stylesheet"> "assets/css/..." is a relative path, so it means "http://domainname/product/assets/css/...". PHP Code: <link href="<?= base_url('assets/css/...');?>" rel="stylesheet"> What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |