0
Options +FollowSymLinks
RewriteEngine On    # Turn on the rewriting engine
RewriteRule "^bar/(.*)$" "bar.php?sef_link=$1"

my htaccess rule is work but css, images and js files does not load.

when i look into source code, css file redirect :

localhost/css/style.css

but my css path is : localhost/night-rock/css/style.css

how can i fix this problem ?

i tried to add "/" before call css path :

<link href="/css/style.css" rel="stylesheet" type="text/css">

if i tried without "/" it search in:

http://localhost/night-rock/bar/css/style.css
8
  • remove the preceeding / in your html so it will be relative, ie : <link href="css/style.css" rel="stylesheet" type="text/css"> Commented Jan 19, 2016 at 15:40
  • @Pogrindis it tried it, but does not work. Commented Jan 19, 2016 at 15:41
  • What is the route 404 when you remove it ? Commented Jan 19, 2016 at 15:41
  • 1
    Try going up a directory before looking for the css directory: <link href="../css/style.css" rel="stylesheet" type="text/css"> Commented Jan 19, 2016 at 15:41
  • 1
    remove bar/ from your htaccess or if this folder exists (/bar).. Then add ../css to your HTML Commented Jan 19, 2016 at 15:42

1 Answer 1

1

Try remove bar/ from your htaccess file.

Or if this folder does exists (/bar)..

Then add ../css to your HTML which will give it a relative path to the parent folder.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.