.htaccess 301 vs. 302 Enforcing HTTPS

The different .htaccess/mod_rewrite directives you see around are usually because of differences in the server configuration (nothing to do with WordPress) and where they are being used. There’s no such thing as a one size fits all. (For instance, the above redirect may not work if you are behind an SSL proxy.) However, as with … Read more

RedirectMatch and Redirect interfering with each other

RedirectMatch and Redirect interfering with each other In the example you’ve given, RedirectMatch (mod_alias) and RewriteRule (mod_rewrite) are “interfering with each other”, not Redirect. Redirect is a mod_alias directive, that works with RedirectMatch – so you wouldn’t necessarily expect these to conflict in this way. As mentioned above, RewriteRule is a mod_rewrite directive, whereas RedirectMatch … Read more

How can I code my plugin to safely modify .htaccess?

/wp-admin/includes/misc.php includes the function insert_with_markers() : /** * Inserts an array of strings into a file (.htaccess ), placing it between * BEGIN and END markers. * * Replaces existing marked info. Retains surrounding * data. Creates file if none exists. * * @since 1.5.0 * * @param string $filename Filename to alter. * @param … Read more

Remove File Extension for Page Outside of WordPress

…but that still didn’t remove the extension. To be clear, the extension should already be removed in the HTML anchor/link. The purpose of .htaccess is primarily to rewrite the extensionless URL back to the underlying filesystem path (which contains the file extension). RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L] Apart from rewriting to .php, not … Read more

How have I misconfigured basic auth for my wordpress site?

Ok editing the default-ssl.conf as described here (or in my case /etc/apache2/sites-enabled/mysite.com-le-ssl.conf) to add auth settings to the end of the Virtual Host block works fine now. So it’s now: <IfModule mod_ssl.c> <VirtualHost *:443> ServerName mysite.com ServerAlias www.mysite.com ServerAdmin webmaster@localhost DocumentRoot /var/www/mysite.com ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined Include /etc/letsencrypt/options-ssl-apache.conf SSLCertificateFile /etc/letsencrypt/live/mysite.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/mysite.com/privkey.pem <Directory “/var/www/mysite.com”> … Read more

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