Posts Tagged ‘Apache’

WordPress with not-so-decent subdomain hosting.

Wednesday, June 11th, 2008

Like I posted some time ago, I had some problems resolving the rewrite engine when trying to access my kickstart page (http://vstone.eu/kickstart) and separating it from http://kickstart.vstone.org. I proposed a solution but that only worked half the time. It was a work around at the time, but it gave me some problems in the end. Since the check for the referer was in there, I couldn’t access my wordpress/wp-admin page anymore when using the link on the main page. This gave me a nice 404.

So, I decided to be smart about it, reset the .htaccess file in my root folder to the default one for wordpress and adjust a separate .htaccess file in the kickstart subfolder. It looks like this:

<IfModule mod_rewrite.c>
RewriteEngine On

# BEGIN WordPress
RewriteBase /kickstart/
RewriteCond %{HTTP_HOST} !^kickstart.vstone.org$ [NC]
RewriteRule . /index.php [L]
# END WordPress
</IfModule>

By setting the RewriteBase to /kickstart/, I’m already sure this rewrite condition will never match ‘http://kickstart.vstone.org/’. This could only give me problems when I have sth like http://kickstart.vstone.org/kickstart/. So, I also make sure that the HTTP_HOST never is kickstart.vstone.org.

After that, I can be pretty sure I can rewrite it to the index file used for wordpress.

Kickstart BASH Kickoff

Tuesday, May 27th, 2008

Yesterday, I finished putting up the Kickstart BASH page. More information can be found here.

At the same time, I fixed some SSL issues I was having on my home-webserver. Apparently, ssl doesn’t play nice with Namebased Virtual Hosts – which gave me some issues getting the right certificate in place. It’s a self signed one so you might get a little warning about that. It’s not going to change any time soon (as long as I’m hosting the svn repo myself that is).

Planned for later this evening: Setting up http://kickstart.vstone.org/, which will host the actual script in action. I ran into some problems again here: since my webhosting puts subdomains in a subfolder in my htdocs root, I had to do some magic rewriting to forward only ‘kickstart.vstone.org’ to the proper location.
For those of you who care: the solution was to add a rule to my wordpress rewrite rules in the .htaccess file. I’ve added the condition to check whether or not the server was accessed by ‘www.vstone.org‘ or ‘kickstart.vstone.org‘.

.htaccess file

# BEGIN WordPress
RewriteBase /
RewriteCond %{HTTP_REFERER} ^(http://|https://)(www.)?(vstone.org).*$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} !^kickstart.vstone.org.*$ [OR]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress