Interaction of .htaccess, WP_HOME, and WP_SITEURL

for your sanity you should not put different sites in the same web “directory” it brings clutter and possible unindended interactions without gaining anything. WP_HOME and WP_SITEURL might be an historical artifact (even when I start to develop for wordpress at version 2.x I could not figure out who needs it) maybe from the times … Read more

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 … Read more

Avoid duplicate content on pretty URLs with htaccess

To ensure that your URLs have a consistent trailing slash and avoid duplicate content, you can use the following .htaccess rules. These rules will enforce a single trailing slash for URLs and redirect any URLs without or with multiple trailing slashes to their correct form. Here’s the updated .htaccess code: # Enable rewrite engine RewriteEngine … Read more

How to I serve the static HTML file at the root directory in a wordpress site?

I needed the same thing – a ‘landing’ page at the root site that was custom-built (via PHP), but then WordPress-based pages elsewhere. I did it with the htaccess file for the site: # For example.com root, set landing.php as the default page RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ [NC] RewriteRule ^$ /landing.php [L] This will redirect www.example.com … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)