the official blog of hyperco.de web services and its cio
In: random stuff
2 Nov 2009
I thought it would be cool to not have the meta-widget on my wordpress blog enabled as there is probably little need for visitors to have a login-link visible on the start page.
If you are used to simple naming conventions from rails you expect to have the login in my case on http://blog.hyperco.de/login - but the wordpress login page sits in wp-login.php - that is wordpress' general design rule. All of the pages in the wordpress root start with 'wp-' and end with '.php' - whether you like it, or not.
So I thought, wouldn't it be nice to have apache redirect all requests to files not found on the disk to the wordpress style named files?
I assume you are using apache web server and you have the RewriteEngine aka mod_rewrite enabled, then this will do the trick:
RewriteEngine on
RewriteCond %{LA-U:REQUEST_FILENAME} !-f
RewriteCond %{LA-U:REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^(.*)\.php$
RewriteRule ^/(.*)$ /wp-$1.php [R=307]
This peace of code you can easily be pasted into your vhost config or .htaccess file or whatever else config file you are using.
you are watching the official blog of hyperco.de web services