Tag Archives: wordpress

WordPress Permalink 404 with HTTPS

The time had come to switch this blog to HTTPS given the ease and cost ($0) of deploying certificates from LetsEncrypt. So that was easily done under Apache – create a new conf file for the SSL site in /etc/apache2/sites-available, and then update the old conf for the non-SSL site to redirect before requesting a new cert using certbot-auto -d mike.mcmurray.co.nz –apache. WP handled that just fine but only the admin pages and the main home page displayed as expected, other pages were just a 404.

So I made the .htaccess file writable by WP and updated the permalink rules from the WP admin console to have the file updated. Nope, still the same.

The rewrite rules are the issue, it’s just that they’re not being allowed to work. The new conf file for the SSL config needs to allow the web server to override the more secure defaults. So this needs to be in the SSL configuration file – note this is a sub-section, not the whole thing.

 <VirtualHost _default_:443>
     ServerAdmin admin@yoursite.com
     ServerName blog.yoursite.com
     ServerAlias blog.yoursite.com
     DocumentRoot /var/www/html/blog

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined

     <Directory /var/www/html/blog/>
         Options FollowSymLinks
         AllowOverride All
         Order allow,deny
         Allow from all
     </Directory>

     # SSL Engine Switch:
     # Enable/Disable SSL for this virtual host.
     SSLEngine on
     ...

</VirtualHost>

 

Running WordPress & PHP Behind ISA Proxy

Some things work well on their own but when mixed make your life hard. Things like Linux and PHP work very well. Microsoft ISA proxy also does a good job in a corporate MS environment. But making the two work together in a controlled environment can be an exercise in frustration.

In this post I’ll pass on the methods I found to get PHP and your Linux boxes talking out through a corporate ISA proxy server. You can then bring in RSS feeds, updates and other things in WordPress and use apt-get to update Ubuntu. Continue reading Running WordPress & PHP Behind ISA Proxy

Using a WordPress Page for your Main Site Content

Official WordPress logoI thought I’d make more use of WordPress on wekadesign.co.nz since it’s very powerful and apparently was recently voted top PHP based CMS ahead of Joomla and many other top-notch products. It’s ease-of-use and interface are all excellent and the massive user base and huge number of plugins make it very attractive for almost any web publishing.

After moving the small amount of static WekaDesign content into Pages, I copied a couple of files (index.php and .htaccess) from my WordPress folder (./blog) into the site root, changed the settings in WordPress (Settings»General»Blog Address) and viola, anyone going to www.wekadesign.co.nz, now hits WordPress. Good. Step one done.

Now to change the default landing page to be a static Page rather than the blog. Just as easy, visit Settings»Reading in WordPress and change the Front Page Displays option to be your Page. Excellent, now everyone lands at the the WordPress version of my static content. But how do you now send people to your old default blog page? You can use http://www.yoursite.co.nz/2009/ to target certain groups of content by date or category if you have Permalinks setup, but I couldn’t find the way that WP builds the default blog page.

It’s not obvious, but that 2nd option in Settings»Reading holds the key. The Posts Page option is asking you to select an existing WP Page that will act as a placeholder and be that default blog page. So, if you haven’t already, create a new Page with a suitable name. The name is important as that’s the URL everyone will use and see for your blog. So if you call the Page “peanut butter”, your blog page will now be http://www.yoursite.co.nz/peanut-butter/. It doesn’t matter what the content of the Page holds as no one will ever see it.

There is a slight “gotcha” with the Page names, in that any name being reused will work, but WP will append it with an incrementing number e.g. “peanut-butter-2”.

To finish off, just create a nice link on your site somewhere like the Sidebar to your default blog page.