Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Apache Rewrite question - help!!

Author
Message
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 5th Jul 2006 21:13
This has been bugging me for hours...


Basically, I want to convert an incomming URL like this:
Quote: "/news/index?region=global&news_item_id=148555"


to this:
Quote: "/node/148555"


According to my brain (which clearly is wrong) the above rule/condition says:
Quote: "Look at the Query String and match "news_item_id='a number'" and rewrite the entire URL with "/node/'a number'" and make that a 301 redirect and the last rule."


The resulting URL, in fact, comes out as:
Quote: "/node/148555?region=global&news_item_id=148555"


Does anyone have any idea's how to stop it tagging the query onto the end of the Substitution URL? Is it something to do with only making the condition the query?!

Cheers guys, I know at least one of you will know what I'm doing wrong!!

[center]
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 5th Jul 2006 22:23
I hate to double post, but I have got no further and cant for the life of me figure out why its happening...

[center]
Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 5th Jul 2006 22:50
Well I solved it... All it needed was a question mark... If anyone could explain why - I'd appreciate it!



[center]
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 6th Jul 2006 08:33
is it a hook statement like in cgi
is it a constant for print or out>>

Nicholas Thompson
20
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Bognor Regis, UK
Posted: 6th Jul 2006 09:30
I'm not wure what a CGI hook statement is (never done any CGI, I started web development as that was going out of fashion and being replaced with PHP/ASP).

I dont think its a print or constant - but could be wrong. I'll look into that one.

Thanks for the reply indi - I appreciate it. I'm surprised nobody else has replied tho...

[center]
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 7th Jul 2006 03:25
There is probably only a few who have delved that deep around here.

Login to post a reply

Server time is: 2024-11-17 08:04:48
Your offset time is: 2024-11-17 08:04:48