Page 1 of 1

Convert URL

Posted: Mon May 04, 2009 4:22 pm
by Chivalry
I don't know if a PHP forum is the best place to ask this, but I'm hoping that someone here will either know the answer or be able to point me to a better place.

What I want is fairly simply. If my web server is sent a request for a URL of the form http://domain.com/1234, I want this to be interpreted as http://domain.com/index.php?param=1234. Is this possible, and if so, any pointers on how to accomplish this would be gratefully accepted.

The server is Mac OS X Leopard, so the web server is Apache. The database server can be either MySQL or FileMaker, whichever works best.

Thanks,
Chuck

Re: Convert URL

Posted: Mon May 04, 2009 4:38 pm
by jayshields
You'll want to look around for rewrite rules. These are typically handled by .htaccess files in Apache. Either search on this forum or on Google and you'll be sure to find something.

Re: Convert URL

Posted: Wed May 06, 2009 6:26 pm
by ldougherty
Try this; create a .htaccess in your web root with the following information:

Code: Select all

 
 
RewriteEngine on
RewriteRule ^1234$ /index.php?param=1234$1