Alex
Alex

Reputation: 115

Allow stylesheet in rewrite engine

I have a temporary coming soon page while i test our new website. i have setup an redirect in the .htaccess file using the below code. Problem is that it doesn't get the stylesheet. Any help appreciated, thanks

<IfModule mod_rewrite.c>

 RewriteEngine on

 RewriteCond %{REMOTE_ADDR} !^7\.150\.99\.110

 RewriteCond %{REMOTE_ADDR} !^82\.31\.116\.41
 RewriteCond %{REMOTE_ADDR} !^localhost

 RewriteCond %{REQUEST_URI} !/coming-soon.php$ [NC]

 RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC]

 RewriteRule .* /coming-soon.php [R=302,L]

</IfModule>

Upvotes: 1

Views: 61

Answers (1)

anubhava
anubhava

Reputation: 785376

Add .css and .js in excluded list:

 RewriteEngine on

 RewriteCond %{REMOTE_ADDR} !^7\.150\.99\.110
 RewriteCond %{REMOTE_ADDR} !^82\.31\.116\.41
 RewriteCond %{REMOTE_ADDR} !^localhost
 RewriteCond %{REQUEST_URI} !/coming-soon.php$ [NC]
 RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif|css|js) [NC]
 RewriteRule ^ /coming-soon.php [R=302,L]

Upvotes: 2

Related Questions