Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 06-09-04
25 chars.? Need more spac
 
Join Date: Aug 2003
Location: here
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
madstock is an unknown quantity at this point
  301 redirects?

I have recently registered a shed load of domains and walloped together "mini sites", using info that was previously part of our main directory site - i.e. instead of http://www.mainsite.co.uk/bananas there is now http://www.minibananasite.co.uk (with the previous directory "bananas" now pointing at the new site).

All of this is fine and dandy, however under the old site I had a set up like:

http://www.mainsite.co.uk/bananas/details.php?q=bananaretailer1 - this would then give a lovely optimised page that details all about "bananaretailer1" - what I would like to do is automatically redirect this to the new site, but I really haven't got a Scooby, to utilise the language of my 4-year old...

I understand that a 301 within a .htaccess goes something like:

Redirect 301 /page.php http://www.newsite.co.uk/newpage.php

However I would like to make:

http://www.mainsite.co.uk/bananas/details.php?q="WHATEVER"

resolve to

http://www.minibananasite.co.uk/details.php?q="WHATEVER"

where the bit after q= is a variable, as opposed to a constant string..

Please can someone put me out of my misery?

Cheers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-09-04
loquax's Avatar
www.onelittleduck.co.uk
 
Join Date: Aug 2003
Location: Swansea
Posts: 2,516
Thanks: 13
Thanked 30 Times in 18 Posts
loquax seems to know their stuff
Have you tried

Redirect 301 /bananas/ http://www.minibananasite.co.uk/

think that should work?

Jason
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-09-04
25 chars.? Need more spac
 
Join Date: Aug 2003
Location: here
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
madstock is an unknown quantity at this point
Thanks Jason - that is what we are doing for the "main" directories - the problem was with redirecting variables as opposed to a static constant - e.g. if someone clicks on a link to

http://www.oldsite.com/olddirectory/search.php?q=WHATEVER&order=WHATEVER

they are automatically redirected to:

http://www.newsite.com/newsearch.php?q=WHATEVER&order=WHATEVER

If it helps, there are only a couple of these types of files, they are all php, so I suppose I could edit the existing PHP file - which would lead to a further question - "How would one go about making dynamic php redirects" -

e.g.

1) Create a file called "details.php", which takes the bit after q=

<?

$details=$q;

echo $site[$details]."";

?>

2) Call the output of details.php within the header of

<?
include ("details.php");
Header ("Location: http://www.site2.co.uk/search.php?q=$details"); ?>

The problems with this are threefold:

1. The Header function cannot be used, as a header has already been called

2. "fopen" would expect more than 1 variable, and

3. I haven't really got the foggiest about what I am doing

If there is a simple "write this page" function that can be used instead of Header , above I would probably be on my way...

Apologies for the rambling once again...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-09-04
morleymouse's Avatar
Super Member
 
Join Date: Aug 2003
Location: Costa Del Sheffield
Posts: 2,752
Thanks: 3
Thanked 10 Times in 6 Posts
morleymouse is an unknown quantity at this point
edit search.php to contain

<?

$url = "http://www.newsite.com/newsearch.php?q=$q&order=$order";

header ("Location: $url"); ?>

that should work
__________________
Dan Morley
Alpharooms.com
daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
My Blog | Cheap Holidays
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #5 (permalink)  
Old 06-09-04
25 chars.? Need more spac
 
Join Date: Aug 2003
Location: here
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
madstock is an unknown quantity at this point
That is spot-on, thanks hugely!

The best bit is that I can see why it works too - thanks again..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 06-09-04
morleymouse's Avatar
Super Member
 
Join Date: Aug 2003
Location: Costa Del Sheffield
Posts: 2,752
Thanks: 3
Thanked 10 Times in 6 Posts
morleymouse is an unknown quantity at this point
no problemo
__________________
Dan Morley
Alpharooms.com
daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
My Blog | Cheap Holidays
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7