Take the Theme Switcher plugin to the next level – static URLs

Lots of Wordpress theme designers & developers use Ryan Boren’s Theme Switcher plugin,  a very light-weight plugin which does exactly what its title says. It gives the possibility to preview any uploaded theme.

As you know the default string to preview a theme is index.php?wptheme=theme name . That isn’t very cool is it? TBH its damn ugly and long. Doesn’t testsite.com/theme name/ sound a lot better? I bet it does!

If you take a look at my blog’s free themes seciton you will notice that every live demo url is a static. I have lots of customers to manage, and spending my time on setting up 10 tets blogs would be dumb, so i did this trick and i can show every customer his theme and wait for feedback. Its a lot cleaner than the dynamic url.

Here’s how to rewrite the dynamic url to a static one:

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^([A-Za-z0-9]+)/?$ index.php?wptheme=$1

Copy this code and paste it into your .htaccess file right in front of # BEGIN WordPress.

Other info:

  • This tweak was tested and is fully functional if you do it as instructed.
  • It does not affect in any way your permalink structure.

Have fun & enjoy!

Did you find this information helpful? Buy me a coffee.

Enjoyed this post? Subscribe to my RSS feed today!

Respond

User Comments

  • Gina - 02 Apr 2009 8PM

    Hi, great share, i tried on my blog but i can`t make it work properly. When i enter ex. mysite.com/theme/ it changes the theme but does not show the content. Only the changed theme with a 404 not found page. Can you advice please ?

    Cheer,
    Gina

  • Hosting Reviews - 23 Jul 2009 2PM

    Cool man. This will be VERY useful when I launch my Wordpress Themes download site. Thanks so much for the htaccess code.