WordPress pages break with custom permalink settings (theme directory not output)

This was resolved with the help of @AndyMacaulay-Brook The htaccess had some incorrect (non-wp declarations) which when removed solved the issue: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wp/ RewriteRule ^index\.php$ – [L] … Read more

Steps for WordPress over SSL

It is not absolutely necessary to add anything to the config file. However it’s a good idea to do a test to look for any unsecured Http calls, such as stylesheets or Scripts. A good resource for this is https://www.whynopadlock.com/. The force SSL Setting can sometimes help with requests coming from plug-ins or anything you … Read more

.htaccess redirects for posts in new directory and new domain

You could use mod_rewrite with some regex like this: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^/old/(.*)/?$ http://newdomain.com/new/$1 [R=302,L,NC] </IfModule> This would go in the .htaccess file in the olddomain.com document root. I’d suggest leaving it as a 302 until you are sure it’s having the desired effect, as most browsers will cache 301’s and then not … Read more

How to add gallery slug to attachment url?

So I was able to make it work (without .htaccess as Tom sugested) using WordPress Rewrite API. Here is my working code (from functions.php): function add_rewrite_rules( $wp_rewrite ) { $new_rules = array ( ‘(the-gallery-slug)\/(.?.+?)(?:/([0-9]+))?/?$’ => ‘index.php?pagename=$matches[2]’ ); // Always add your rules to the top, to make sure your rules have priority $wp_rewrite->rules = $new_rules … Read more