Add htaccess rules with insert_with_markers at beginning of htaccess

Using insert_with_markers() function you can insert your rules only between WordPress comments e.i. # BEGIN WordPress and # END WordPress. So, you should use plain PHP to achieve your aim. Create your rules Read existing .htaccess and concatenate your and existing rules Write the file Here is a dirty example: <?php $str = “# BEGIN TEST\n# MY RULES\n# END TEST\n”; … Read more

Special domain for a page

There is a plugin that does exactly this: https://wordpress.org/plugins/multiple-domain-mapping-on-single-site Anyway, it would be nicer to have things under control with an understandable few lines of script, so I’m still open to answers

Cache policy not updated according to PageSpeed

ExpiresByType text/x-javascript “access plus 1 month” ExpiresByType text/javascript “access plus 1 month” ExpiresByType application/x-javascript “access plus 14 days” In order to determine the correct mime-type to use you need to look at the Content-Type HTTP response header from your server (using your browser). The default for JavaScript files is application/javascript – which you’ve not included … Read more

Redirecting old post url to 404 in wordpress using htaccess

I think doing this within WordPress is probably the preferred approach, as mentioned in @Harrison’s answer, however, to answer your specific queries… RewriteEngine On Redirect 404 /article.html Aside: The RewriteEngine directive relates to mod_rewrite, however, Redirect is a mod_alias directive – so these two directives are unrelated. However, this should “work” with a default WordPress … Read more

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