Forum Moderators: phranque

Message Too Old, No Replies

help with htaccess

         

lmark

4:52 am on Jun 21, 2012 (gmt 0)

10+ Year Member



Hi,

I'm new here and I have a small problem writing an htacess url rewrite.

I need the user to see a link that looks like this:

www.mysite.com/product-catalog/part_1

and the server to get a link that looks like this:

www.mysite.com/index.php/product-catalog?ad=part_1

I would be really grateful if anyone could help me out with this.

Thanks :)

g1smd

6:07 am on Jun 21, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



As this question is asked almost every day here, we ask you read back through some of the previous times this was discussed and grab some code ideas from there. As a rough estimate this has been asked at least 1000 times so far. The last time was only yesterday. :)
[google.com...]

Additionally, as the sticky thread says, please use example.com or example."any TLD" in code examples in this forum.

lmark

10:13 am on Jun 21, 2012 (gmt 0)

10+ Year Member



I have looked into quite a few of these and believe me I would not have asked the question had I understood any of the answers.

I would greatly appreciate some help here, thanks.

lucy24

4:59 pm on Jun 21, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You're welcome.

g1smd

5:47 pm on Jun 21, 2012 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm not sure what different words I could use in this thread compared with what I wrote in the previous threads.

Certainly cutting and pasting one of those answers here would appear to be a futile exercise.

lmark

9:21 pm on Jun 21, 2012 (gmt 0)

10+ Year Member



Sorry, maybe I'm jusr dense, but I didn't see anything that could solve my problem here in the other threads.

Thanks though.

lmark

6:42 am on Jun 22, 2012 (gmt 0)

10+ Year Member



Om, sort of at my wits end here...

I tried the following:
to get example.com/ad/part_1 to rewrite to example.com/product-catalog?ad=part_1

I did:

RewriteCond %{URL} ^ad/(.*)$
RewriteRule ^(.*)$ product-catalog?ad={C:1}

Can anyone tell me where I'm going wrong?

Thanks :-*