Life, Code & Idiocy

Bloggage of a web coding nutcase

16 Jun 2006

Apache, No-IP Wildcards, and virtual hosts

I’m currently trying to figure out how in the world you’re supposed to do this…I want to have blogs.fuhrykitchentable.no-ip.org be this blog site and www.fuhrykitchentable.no-ip.org be the main site…and I have no idea how to do it. I tried using mod_rewrite and a specialized PHP script to do it…it worked, but it was very slow and virtual directories (like in AdvancedArticles) didn’t work. I want to have a way to do this using pure .htaccess mod_rewrite rules (there is a way it can be done) but I have no idea how to do this. Once I’m done with it I’m sure it will be really great.

Update: I got it! Ironically, none of the methods on the web worked, but my own (very little) experience with regular expressions guided me towards creating a working sub-subdomain system. w00t!

Update 2: I just moved to the Linux box that’s hosting this blogsite so now I can post the contents of the .htaccess file that powers the site. Here it is:

php_flag register_globals off
RewriteEngine on
RewriteCond %{HTTP_HOST} ^blogs.fuhrykitchentable.no-ip.org$
RewriteCond %{REQUEST_URI} !servlet/(.*)
RewriteRule (.*) servlet/blogs/$1

RewriteCond %{HTTP_HOST} ^www.fuhrykitchentable.no-ip.org$ [OR]
RewriteCond %{HTTP_HOST} ^fuhrykitchentable.no-ip.org$
RewriteCond %{REQUEST_URI} !servlet/(.*)
RewriteRule (.*) servlet/www/$1 [L,QSA]

No Responses to “Apache, No-IP Wildcards, and virtual hosts” (post new)

 

Leave a Reply