Reputation: 17383
I'm using this htaccess
to force all request with www. but my resources don't loaded:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^shadyab.com [NC]
RewriteRule ^(.*)$ http://www.shadyab.com/$1 [L,R=301,NC]
RewriteRule ^ /index.html [L]
this is my site:
for example:
http://www.shadyab.com/assets/plugin/slider/css/owl.carousel.min.css
Upvotes: 0
Views: 23
Reputation: 143896
Your second rule rewrites everything to index.html, including all your css
If you really want to rewrite every request to index.html, but still want your resources, you can exclude them using a condition, otherwise remove the rule.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^shadyab.com [NC]
RewriteRule ^(.*)$ http://www.shadyab.com/$1 [L,R=301,NC]
RewriteCond %{REQUEST_URI} !\.(css|js|png|jpe?g|gif)$ [NC]
RewriteRule ^ /index.html [L]
Upvotes: 2