Forum Moderators: phranque

Message Too Old, No Replies

rewrite path to file based on referrer

mod rewrite, referrer

         

sasori

6:20 pm on Aug 28, 2009 (gmt 0)

10+ Year Member



I have a few items up on a site that I can't edit and they're linked to the wrong location.
They're link is like this:
-------------------------
[tracker.quux-foo.com...]
------------------------
which goes to:
http://www.example.com/online_store/products/Ladies_Jewelled_Top-341-120.html
--------------------------
I need it to go here:
http://www.example.com/diditonilne/index.php?p=catalog&mode=search&search_in=all&search_str=10966SJ_BK
--------------------------

I've looked everywhere and can't find an example of a direct rewrite like this.

Can you help?

[edited by: jdMorgan at 1:40 am (utc) on Aug. 29, 2009]
[edit reason] example.com [/edit]

wilderness

8:39 pm on Aug 28, 2009 (gmt 0)

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



refer+redirect [google.com]

jdMorgan

1:43 am on Aug 29, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It is very likely unnecessary to consider the referrer in this case.

This is simply a matter of using mod_rewrite to test the query string using a RewriteCond examining %{QUERY_STRING} and redirecting requests for the URL-path "online_store/products/Ladies_Jewelled_Top-341-120.html" to the correct URL plus query string using a RewriteRule.

Jim