Passing parameters in URL but without mentioning the PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
teominator
Forum Newbie
Posts: 1
Joined: Sat Dec 18, 2010 4:03 am

Passing parameters in URL but without mentioning the PHP

Post by teominator »

Hi,

i'm new here. My question is: can i use PHP to handle parameters sent this way

http://bit.ly/12323 (where i consider 12323 the parameters)

rather than this way?

http://example.com/somephpfile.php?param=value

Thanks,
Teo
parino_esquilado
Forum Newbie
Posts: 13
Joined: Wed Apr 22, 2009 12:22 pm

Re: Passing parameters in URL but without mentioning the PHP

Post by parino_esquilado »

Yes, you can, editing the apache.htaccess file.

Rewrite Engine:

RewriteRule ^([A-Za-z0-9_-]+)\$ somefile.php?value=$1 [L]
Last edited by parino_esquilado on Sat Dec 18, 2010 4:14 am, edited 1 time in total.
internet-solution
Forum Contributor
Posts: 220
Joined: Thu May 27, 2010 6:27 am
Location: UK

Re: Passing parameters in URL but without mentioning the PHP

Post by internet-solution »

you will need mod_rewrite in apache see examples here
parino_esquilado
Forum Newbie
Posts: 13
Joined: Wed Apr 22, 2009 12:22 pm

Re: Passing parameters in URL but without mentioning the PHP

Post by parino_esquilado »

Yeah, that's it. Mod_rewrite =)
Post Reply