.htaccess - Clean-URL -> URL's with only 1 parameter works, but with more than 1 parameter CSS-file will not be included -


i use clean-url in project. simplicity simplified code.

my .htaccess:

rewriteengine on  rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . index.php [l] 

my index.php:

<?php      require_once "/login.php";  ?> 

the .css-file include in html-part in login.php:

<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet"> 

my project structure:

in root-folder "test" index.php, login.php , bootstrap-directory.

and problem:

if request url 1 parameter

http://localhost/test/bla working! 

but if request url 2 paramter like:

http://localhost/test/bla/bla  

then login-page showing, without css-styles (css-file not included...).

but why?

first, if htaccess in test folder, should this

rewriteengine on rewritebase /test/  rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . index.php [l] 

then, have add rewrite base (for absolute path many virtual directories) css , js links

<link href="/test/bootstrap/css/bootstrap.min.css" rel="stylesheet"> 

but use in html page , keep css/js links unchanged

<base href="/test/" /> 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -