.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
Post a Comment