Htaccess to redirect whole website to coming soon html page

To redirect an entire WordPress site to a specific HTML page using .htaccess, you can set up a redirect rule in the .htaccess file located in your site’s root directory. Add rewrite rules immediately after “RewriteEngine On”

# Redirect all traffic to a specific HTML page
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/specific-page.html$  # Prevent redirect loop
RewriteRule ^(.*)$ /specific-page.html [L,R=301]

Explanation:

RewriteEngine On: Enables the mod_rewrite engine to handle redirects.

RewriteCond %{REQUEST_URI} !^/specific-page.html$: Prevents a redirect loop by making sure that requests to the target page (specific-page.html) don’t get redirected again.

RewriteRule ^(.*)$ /specific-page.html [L,R=301]: Redirects all requests (for any URL) to /specific-page.html.

The [L,R=301] flags:

  • L: Indicates that if this rule is applied, no further rules should be
    processed.

  • R=301: Performs a “permanent” redirect (HTTP 301), which is
    recommended for SEO.

Let me know if you need further assistance!

techhipbettruvabetnorabahisbahis forumutaraftarium24edusedueduedusedusedueduedueduedus