natasha_thomas Posted April 25, 2010 Share Posted April 25, 2010 My Friends, I am doing a site, generated on the fly, with PHP Script. Problem is: When you hover over a link, it looks like: http://www.mysite.com/index.php?p1=i phone 3gs at discount prices&p2=BEIOH3827K Obeserve the Spaces in the URL and instead of P1 and P2 it should show: / So i want it to look Like: http://www.mysite.com/index.php/i-phone-3gs-at-discount-prices/BEIOH3827K Funny thing is: In my Htaccess a line is auto generated, i do not even know what it means: RewriteRule ^files/([^/]+)/([^/]+).htm$ /index.php?p1=%%Title%%&p2=%%ASIN%% [NC,L] Please someone, help me to achieve the Link Structure i am looking for..... Thanks in Advance Natasha T. Quote Link to comment https://forums.phpfreaks.com/topic/199656-htaccess-please-pleasehow-to-make-my-url-look-pretty/ Share on other sites More sharing options...
Mchl Posted April 25, 2010 Share Posted April 25, 2010 Please take a look into thing called 'mod_rewrite' Quote Link to comment https://forums.phpfreaks.com/topic/199656-htaccess-please-pleasehow-to-make-my-url-look-pretty/#findComment-1047911 Share on other sites More sharing options...
cags Posted April 25, 2010 Share Posted April 25, 2010 The line in your .htaccess file will take any URL that looks like http://domain.com/files/something/something.htm and actually show the page which is represented by the other URL. I'll be honest though I have no idea what %%Title%% or %%ASIN%%. In order to make your links into the format you mention, you need to change the logic that outputs the link to output the new format, you then need to add another line to your .htaccess file that redirects that style of link to the link style you currently have. As mentioned by Mchl, search for mod_rewrite and you'll find hundreds of tutorials and resources. If you need any more specific help then you'll have to let us know. Quote Link to comment https://forums.phpfreaks.com/topic/199656-htaccess-please-pleasehow-to-make-my-url-look-pretty/#findComment-1047918 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.