28, May 2012

need to redirect some pages - webmaster forum

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: need to redirect some pages
« previous next »
Pages: [1] Print
Instabuck - The easy way to sell digital products online

Author Topic: need to redirect some pages  (Read 1662 times)
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« on: May 30, 2007, 10:45:29 am »

Hi,

Don't get it working:

I want redirect http://www.domainone.com/?cat=9

to http://www.betterdoman.com/some/nice-link/

I tried that rule (also others)

Code:
RewriteCond %{HTTP_HOST} ^(www\.)?domainone.com [NC]
RewriteCond %{REQUEST_URI} ^/?cat=
RewriteRule =9$ http://www.betterdoman.com/some/nice-link/ [R=301,L]


suggestions?

I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 5799
46391 credits
Members referred : 3



« Reply #1 on: May 30, 2007, 01:11:43 pm »

Hmmm. I would do that with php. It is a lot easier this way Smiley

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: May 30, 2007, 01:42:24 pm »

yeah you're right it's working now Smiley

Where are my glasses?
*
Posts: 23
146 credits
Members referred : 0



« Reply #3 on: May 30, 2007, 03:56:51 pm »

I want to do this too, how did you get it to work?
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6691
34714 credits
Members referred : 374


It's time to use PHP5!


« Reply #4 on: May 30, 2007, 04:15:36 pm »

I want to do this too, how did you get it to work?

Code:
<?php
if ($_SERVER['HTTP_HOST'] == 'adsense.net' || $_SERVER['HTTP_HOST'] == 'www.adsense.net') {
if (!empty($_GET['cat'])) {
switch ($_GET['cat']) {
case 13:
$link 'http://www.dom.com/archives/adbrite-the-internets-ad-marketplace/';
break;
case 4;
$link 'http://www.dom.com/archives/yahoo-publisher-network/';
break;
default:
$link '/default.php';
}
} else {
$link '/default.php';
}
} else {
$link '/index.html';
}
header ('HTTP/1.1 301 Moved Permanently');
header('Location: '.$link);
exit;
?>


Where are my glasses?
*
Posts: 23
146 credits
Members referred : 0



« Reply #5 on: May 30, 2007, 04:20:51 pm »

Thanks bunches! I will have a look.
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=6652
Tags : rewrite Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: need to redirect some pages
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 07:42:06 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.