Forum Moderators: phranque

Message Too Old, No Replies

rewriting help needed

         

akreider

6:10 am on Nov 18, 2005 (gmt 0)

10+ Year Member



I'm trying to rewrite the first into the second:
editperson.php?id=10&
editobject.php?gsObjname=person&id=10&

I'm not good with regular expressions, so my attempts are failing and I'd appreciate help.

jdMorgan

9:49 pm on Nov 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Please post your best effort at coding this, and also specify which parts of the source and destination URLs are fixed and which are variables -- We need to know how you intend to 'derive' the new URL(s) from the information in the old one(s).

Jim

volatilegx

9:54 pm on Nov 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Maybe...

RewriteRule editperson\.php\?id=(.*)& editobject.php?gsObjname=person&id=$1& [NE]

akreider

10:08 pm on Nov 18, 2005 (gmt 0)

10+ Year Member



That was similar to my best attempts and it gives an error:

The requested URL /editperson.php was not found on this server

I'm wondering if you can only rewrite the page name, and you cannot rewrite the query-string (eg the variables after the question mark in the URL).

jdMorgan

10:56 pm on Nov 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You must use
RewriteCond %{QUERY_STRING} _your_pattern_goes_here_
to test and create a back-reference to your query data.

Jim