Advertisement
nicolaslagios

Custom wordpress htaccess for maintenance mode

Apr 11th, 2024 (edited)
751
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Apache Log 1.03 KB | Source Code | 0 0
  1. # The following htaccess code has been built on behalf of Rocket Path P.C. by Nicolas Lagios
  2. # With this modified wordpress htaccess code, you can give full access only to one ip, while every other ip will see the comingsoon.html custom page for any request.
  3. # As you understand, you will need to have a comingsoon.html custom page in the root. Feel free to build it as you wish.
  4. # After that, you can visit whatismyipaddress.com, find your ip and replace !^89\.210\.33\.252$ with your own ip (numbers only)
  5.  
  6. <IfModule mod_rewrite.c>
  7.     RewriteEngine On
  8.  
  9.     # Your custom rules
  10.     RewriteCond %{REQUEST_URI} !^/comingsoon\.html$ [NC]
  11.     RewriteCond %{REMOTE_ADDR} !^89\.210\.33\.355$
  12.     RewriteRule ^(.*)$ /comingsoon.html [L,R=302]
  13.  
  14.     # WordPress default rules (if you have them)
  15.     RewriteBase /
  16.     RewriteRule ^index\.php$ - [L]
  17.     RewriteCond %{REQUEST_FILENAME} !-f
  18.     RewriteCond %{REQUEST_FILENAME} !-d
  19.     RewriteRule . /index.php [L]
  20. </IfModule>
  21.  
  22. <Files "comingsoon.html">
  23.     Require all granted
  24. </Files>
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement