I’ve organized a part of http://code.davidjanes.com/ as follows:
- / – the main page
- /blog/ – the blog
- /genx/demo/ – the demo for GenX
However, I don’t have a /genx/ page (yet) and I plan to do a few more projects with this type of hierarchy. So what to do? Enter Apache mod_rewrite.
In the /genx/ directory I added a .htaccess file with the follow content:
RewriteEngine on RewriteBase / RewriteRule ^$ http://code.davidjanes.com/genx/demo/
Note that this may not work in all hosted environments, because they may not allow per-directory access to .htaccess. In that case, I’d consider adding a “index.html” file to the directory with a meta refresh, as follows:
<html> <head> <meta http-equiv="refresh" content="0;url=http://code.davidjanes.com/genx/demo/"> </head> </html>