.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
Post a Comment