How do I skip wordpress’s 404 handling?

Native WordPress rules are designed to ignore any existing files and directories, including arbitrary PHP scripts. This is literally what this part of directives mean: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d So under normal circumstances WP just shouldn’t be involved with your request in any way. You may have some other rewrite rules interfering, possibly … Read more

302 redirect instead of 301 after switch to HTTPS

RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.janjippe.nl/$1 [R,L] Your “old” .htaccess file at /public_html/.htaccess would appear to have the suspect 302 redirect. Without an explicit status code, the R flag defaults to a 302. If the entire site has been moved to the /private_html folder as part of the implementation of SSL then it would seem … Read more

Redirect www to non-www htaccess

This is what you want: RewriteEngine On RewriteCond %{HTTP_HOST} website\.com [NC] RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://website.com/$1 [R,L] @elgoots, the reason yours was close but still had trouble is your HTTP_HOST has the www in it.

Index in root, wordpress in subdirectory

WordPress core in a subdirectory, but accessed via the root folder If you’re trying to move WP to a subdirectory, but access it from the root, use the following approach. Keep your index file in the root, but point it to the proper path: ./SUBDIRECTORY/wp-blog-header.php instead of ./wp-blog-header.php Make sure you change you change the … Read more

Setting a redirect cookie in wordpress

So the only part that is missing from your code is checking what page you are currently on. The is_page() function is a good way to get this context. You could try it this way (I did not test it, only writeup out of my head to show the concept): function set_newuser_cookie() { if (!isset($_COOKIE[‘subscriber’]) … Read more

WP auto redirects after url change?

Well define “better” 😉 If you do the redirect in the htaccess file the advantage is that it will kick in slightly faster as PHP and WordPress is never bothered and the redirect happens right from the server. But practically on an average site this won’t really make a noticeable difference. Anyway as long as … Read more

Redirecting old permalink to new one

RedirectMatch 301 ^/author/$ ^/auteur/$1 This will only redirect /author/, but the target URL is invalid (with a ^ prefix). The target URL is an ordinary string (that accepts placeholders), not a regex. However, since WordPress already uses mod_rewrite directives for the front controller. You should also use mod_rewrite for this redirect (as opposed to a … Read more

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