.htaccess - shorten url string -


i'ld shorten link. think .htaccess solution fo this, right?

http://www.example.com/myfolder/?option1=hello&name=world&land=how&location=are&city=you 

how can managed? thanks

i think want achive this

http://www.example.com/hello/world/ => http://www.example.com/myfolder/?option1=hello&name=world&land=how&location=are&city=you

right?

if so, can use htaccess this:

rewriteengine on rewriterule ^([a-za-z-_0-9]*)?\/([a-za-z-_0-9]*)\/?$  /app/index.php?option1=$1&name=$2 

the use somehow complicated, idea is:

if open url: http://www.example.com/first/second/

the first: ([a-za-z-_0-9]*) 'captures' word 'first'

the second: ([a-za-z-_0-9]*) 'captures' word 'second'

and converts /app/index.php?option1=first&name=second

check article more info http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html

i'm using [a-za-z-_0-9] because url can contain letters, numbers , underscore. can select characters want.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -