ISHAN MAHAJAN ISHAN MAHAJAN - 3 months ago 11
Apache Configuration Question

My rewritten url redirecting but to a website without css or any other rule being applied

This is my original url

http://havemybooks.com/blog_single?blog_no=39&blog=Ten%20quotes%20by%20national%20leader%20to%20make%20this%20independence%20day%20more%20speacial.


This is my rewritten url

http://havemybooks.com/blog_no/39/blog/Ten%20quotes%20by%20national%20leader%20to%20make%20this%20independence%20day%20more%20speacial.


Here is the code I'm using in .htaccess. I don't know a much about .htaccess so I'm using htaccess generator tool.

RewriteEngine On
RewriteRule ^blog_no/([^/]*)/blog/([^/]*)$ /blog_single?blog_no=$1&blog=$2 [L]


This is the error I get when I inspect elements of my website.

Resource interpreted as Stylesheet but transferred with MIME type text/html

Answer

As Mike commented above, you just need to load the static content from site root. Current, all your URLs are being rendered relative to the page you are visiting.

Add a base tag in the <head> of you pages, and the content will load as required.

<base href="/">