Forum Moderators: phranque

Message Too Old, No Replies

Simple rewrite to keep query only

         

darkyl

4:19 pm on Apr 30, 2008 (gmt 0)

10+ Year Member



Hello,

I need to achieve the following:

Whenever a user goes to www.mysite.com/articolo.asp?idarticolo=814 (where 814 changes depending on the page)
gets redirected to www.mysite.com/idarticolo=814

So basically it has to leave only everything after the question mark.

It should be very simple but it's two days I'm trying following guides and such but cannot succeed.

Can someone suggest me what should I write in htaccess in order to get it working?
Thanks

jdMorgan

3:27 am on May 1, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Please post your best-effort code as a basis for discussion.

Thanks,
Jim

darkyl

11:36 am on May 1, 2008 (gmt 0)

10+ Year Member



This is my last attempt, I took inspiration by a guide <snip> which contains an example very similar to mine:

RewriteRule ^idarticolo=([^.]+).*$ articolo.asp?idarticolo=$1

Please don't laugh, as you can see i'm no expert at all.

[edited by: jdMorgan at 5:58 pm (utc) on May 1, 2008]
[edit reason] No URLs, please. See Terms of Service. [/edit]

jdMorgan

6:04 pm on May 1, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No laughs here. However, I wonder if you've done your homework [webmasterworld.com], rather than looking on-line for a quick fix.

See also this recent thread [webmasterworld.com].

Jim

darkyl

9:41 pm on May 1, 2008 (gmt 0)

10+ Year Member



I've read tons of guides and done a hundred attempts with no success, it's several days i'm working on this (as you can see by other posts).
I always find hints on how to strip the query string, but nothing on how to strip everything except the query string.

jd you're right. I could probably do my homework completely and eventually succeed, but if doing my homework means learning a new language from scratch, that's a problem.

When you have to cover multiple subjects like seo, coding, graphics, site marketing and server language you just can't go too deep in everything.

Not everyone looking for a quick fix is just lazy and simply wants other to do their job.