[svlug] .htaccess rewrite rule

Skip Evans skip at bigskypenguin.com
Thu Mar 6 07:25:48 PST 2008


Hey all,

I need to create an .htaccess rewrite rule to 
convert the following.

The user accesses the site with

http://prepcube.com/wi/madison/

I need a rewrite rule that will convert this to

http://precube.com/index.php?state=wi&school=madison

I know this should rewrite anything to index.php, 
and this is what I have so far:

<IfModule mod_rewrite.c>
         Options +FollowSymlinks
         RewriteEngine On
         RewriteRule ^(.*) index.php [L]
</IfModule>

But I'm not sure how to get the $_GET vars into 
the RewriteRule.

Any help would be greatly appreciated. I'm reading 
up on rewrite rules now, but finding them a bit 
overwhelming at this first attempt.


-- 
Skip Evans
Big Sky Penguin, LLC
503 S Baldwin St, #1
Madison, WI 53703
608-250-2720
http://bigskypenguin.com
=-=-=-=-=-=-=-=-=-=
Check out PHPenguin, a lightweight and versatile
PHP/MySQL, AJAX & DHTML development framework.
http://phpenguin.bigskypenguin.com/



More information about the svlug mailing list