PokeBase Battle Subway Meta-PokeBase Q&A

How did you get 'clean urls' for the site?

0 votes

I like how your site works where you can go to the /pokedex/bulbasaur page and not deal with a lot of code in the url bar. I've been looking to do something like this with a site and can't quite figure url rewriting out, would you reccomend I look into mod rewrite more or maybe something like views with zend? Thanks, Dan

related to an answer for: How did you make this site?
asked Mar 18, 2011 by Skultz

1 Answer

1 vote

I use a PHP framework called CodeIgniter to build the site, which has clean URLs built in. It uses the htaccess file.

But you could do something like this in htaccess:
RewriteRule /pokedex/([a-z0-9-]+) /pokedex.php?pokemon=$1

And then have a script, pokedex.php that handles everything.

answered Mar 18, 2011 by Pokemaster