php - css and image conflicts on. htaccess rewriterule -


i saw many similar problems experiencing followed every solutions , seems can't make run without conflicts.

html css calls:

<head> <base href="http://localhost/smartwavedev.sw_apiwebtool/" /> <link rel="stylesheet" href="assets/css/main.css" type="text/css"> <link rel="stylesheet" href="assets/css/login.css" type="text/css"> <link rel="stylesheet" href="assets/css/dashboard.css" type="text/css"> <link rel="stylesheet" href="assets/css/bootstrap/bootstrap.min.css" type="text/css"> <link rel="stylesheet" href="assets/css/docs.css" type="text/css"> </head> 

.htaccess

rewriteengine on rewritecond %{request_filename} !-d rewritecond %{request_filename}\.php -f rewriterule ^([^/]+)$ $1.php rewriterule ^([^/]+)/([^/]+)$ $1.php?page=$2 rewriterule ^([^/]+)/([^/]+)/([^/]+)$ $1.php?page=$2&nav=$3 

thanks help!

first of condition malformed:

rewritecond %{request_filename}\.php -f 

it should be:

rewritecond %{request_filename} !-f 

now trigger on files. next up, rewritecond match first rewriterule following it. third rule 3 elements still matching (and blocking) css files. either need repeat rewritecond lines rules, or implement better solution. specific case, i'd recommend dropping entire concept of rewriting , replace with:

 fallbackresource index.php 

and parse $_server['request_uri'] in index.php file.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -