Forum Moderators: phranque
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} ^main_page=product_info&cPath=112_80_184&products_id=942$
RewriteRule ^index\.php$ http://store.musicplace.com.au/clarinet-ligatures/401-rovner-clarinet-ligature-and-cap-set.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^main_page=product_info&products_id=942$
RewriteRule ^index\.php$ http://store.musicplace.com.au/clarinet-ligatures/401-rovner-clarinet-ligature-and-cap-set.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^main_page=product_info&cPath=112_80_184&products_id=951$
RewriteRule ^index\.php$ http://store.musicplace.com.au/clarinet-ligatures/410-vandoren-masters-bass-clarinet-ligature.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^main_page=product_info&products_id=951$
RewriteRule ^index\.php$ http://store.musicplace.com.au/clarinet-ligatures/410-vandoren-masters-bass-clarinet-ligature.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^main_page=product_info&cPath=112_80_184&products_id=954$
RewriteRule ^index\.php$ http://store.musicplace.com.au/clarinet-ligatures/403-vandoren-optimum-silver-plated-eb-clarinet-ligatures.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^main_page=product_info&products_id=954$
RewriteRule ^index\.php$ http://store.musicplace.com.au/clarinet-ligatures/403-vandoren-optimum-silver-plated-eb-clarinet-ligatures.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^main_page=product_info&cPath=112_80_184&products_id=945$
RewriteRule ^index\.php$ http://store.musicplace.com.au/clarinet-ligatures/407-vandoren-masters-alto-clarinet-ligature.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^main_page=product_info&products_id=945$
RewriteRule ^index\.php$ http://store.musicplace.com.au/clarinet-ligatures/407-vandoren-masters-alto-clarinet-ligature.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^main_page=product_info&cPath=112_80_184&products_id=935$
RewriteRule ^index\.php$ http://store.musicplace.com.au/clarinet-ligatures/409-vandoren-optimum-silver-plated-bass-clarinet-ligatures.html? [R=301,L]
RewriteCond %{QUERY_STRING} ^main_page=product_info&cPath=112_80_184&products_id=942$
RewriteRule ^index\.php$ http://store.musicplace.com.au/clarinet-ligatures/401-rovner-clarinet-ligature-and-cap-set.html? [R=301,L] RewriteCond %{QUERY_STRING} (^|&)products_id=942(&|$) RewriteCond %{QUERY_STRING} (^|&)products_id=942(&|$)
RewriteRule ^index\.php$ http://store.musicplace.com.au/clarinet-ligatures/rovner-clarinet-ligature-and-cap-set? [R=301,L] RewriteCond %{QUERY_STRING} ^main_page=product_info&cPath=112_80_184&products_id=945$ RewriteCond %{QUERY_STRING} (^|&)products_id=945(&|$) RewriteCond %{QUERY_STRING} (^|&)products_id=([0-9]+)(&|$)
RewriteRule ^(index\.php)?$ /my-special-script.php?oldID=$1[L] <?php
$server = $_SERVER['HTTP_HOST'];
IF (preg_match('/^www\./', $server_url)!==true)
{$server = "www." . $server_url; };
$old_ID = GET['oldID'];
$URL_map = array(
942 => '401-rovner-clarinet-ligature-and-cap-set',
951 => '410-vandoren-masters-bass-clarinet-ligature',
954 => '403-vandoren-optimum-silver-plated-eb-clarinet-ligatures',
945 => '407-vandoren-masters-alto-clarinet-ligature',
935 => '409-vandoren-optimum-silver-plated-bass-clarinet-ligatures'
);
IF ($URL_map[$old_ID] == "")
{
HEADER "Status: HTTP/1.1 404 Not Found";
}
ELSE
{
$new_URL = $server . '/' . $URL_map[$oldID];
HEADER "Status: HTTP/1.1 301 Moved Permanently";
HEADER "Location: " . $new_URL;
}
?>
$server = 'store.musicplace.com.au'; (my initial example was for where you were staying on the same domain and changing only the URL structure). $new_URL = $server . '/' . $URL_map[$oldID]; $new_URL = 'http://' . $server . '/' . $URL_map[$old_ID]; HEADER "Status: HTTP/1.1 404 Not Found"; <html><head>
<title>Page Not Found</title>
</head><body>
<h1>Page Not Found</h1>
<p>We're moving to a new site -</p>
<p><a href="http://store.musicplace.com.au/">store.musicplace.com.au</a></p>
<p>Update your bookmarks.</p>
</body></html> [edited by: g1smd at 11:16 am (utc) on May 23, 2011]
RewriteCond %{QUERY_STRING} (^|&)products_id=([0-9]+)(&|$)
RewriteRule ^(index\.php)?$ /sekrit-folder/product-script.php?oldID=$1[L] <?php
$server = 'store.musicplace.com.au';
IF (preg_match('/^www\./', $server_url)!==true)
{$server = "www." . $server_url; };
$old_ID = GET['oldID'];
$URL_map = array(
1183 => '449-breakthrough-to-improv-the-secrets-of-improvising'
1184 => '450-i-love-the-trumpet'
1757 => '726-francois-louis-ultimate-ligature-clarinet'
935 => '409-vandoren-optimum-silver-plated-bass-clarinet-ligatures'
945 => '407-vandoren-masters-alto-clarinet-ligature'
953 => '398-vandoren-optimum-silver-plated-alto-clarinet-ligatures'
954 => '403-vandoren-optimum-silver-plated-eb-clarinet-ligatures'
1016 => '413-vandoren-optimum-tenor-saxophone-ligature'
957 => '433-francois-louis-the-ultimate-ligature-'
);
IF ($URL_map[$old_ID] == "")
{
HEADER "Status: HTTP/1.1 404 Not Found";
<html><head>
<title>Page Not Found</title>
</head><body>
<h1>Page Not Found</h1>
<p>We're moving to a new site -</p>
<p><a href="http://store.musicplace.com.au/">store.musicplace.com.au</a></p> </p>Update your bookmarks.</p>
</body></html>
}
ELSE
{
$new_URL = 'http://' . $server . '/' . $URL_map[$old_ID];
HEADER "Status: HTTP/1.1 301 Moved Permanently";
HEADER "Location: " . $new_URL;
}
?>
<?php
$server = 'store.musicplace.com.au';
IF (preg_match('/^www\./', $server_url)!==true)
{$server = "www." . $server_url; };
$old_ID = $_GET['oldID'];
$URL_map = array(
1183 => '449-breakthrough-to-improv-the-secrets-of-improvising',
1184 => '450-i-love-the-trumpet',
1757 => '726-francois-louis-ultimate-ligature-clarinet',
935 => '409-vandoren-optimum-silver-plated-bass-clarinet-ligatures',
);
IF ($URL_map[$old_ID] == "")
{
HEADER ("Status: HTTP/1.1 404 Not Found");
?>
<html><head>
<title>Page Not Found</title>
</head><body>
<h1>Page Not Found</h1>
<p>We're moving to a new site -</p>
<p><a href="http://store.musicplace.com.au/">store.musicplace.com.au</a></p> </p>Update your bookmarks.</p>
</body></html>
<?php
}
ELSE
{
$new_URL = 'http://' . $server . '/' . $URL_map[$old_ID];
HEADER ("Status: HTTP/1.1 301 Moved Permanently");
HEADER ("Location: " . $new_URL);
}
?>
IF ($URL_map[$old_ID] == "") Options +FollowSymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} (^|&)products_id=([0-9]+)(&|$)
RewriteRule ^(index\.php)?$ /catalogue/sekrit-folder/product-script.php?oldID=$1[L]
RewriteCond %{QUERY_STRING} (^|&)cPath=([0-9]+)(&|$)
RewriteRule ^(index\.php)?$ /catalogue/sekrit-folder/category-script.php?oldID=$1[L] <?php
$server = 'store.musicplace.com.au';
$old_ID = $_GET['oldID'];
$URL_map = array(
111 => 'store.musicplace.com.au',
112 => '98-woodwind-mouthpieces',
121 => 'store.musicplace.com.au',
116 => '72-trumpet-mouthpieces',
99 => '52-soprano-sax',
);
IF ($URL_map[$old_ID] == "\D")
{
HEADER ("Status: HTTP/1.1 404 Not Found");
?>
<html><head>
<title>Page Not Found</title>
</head><body>
<h1>Page Not Found</h1>
<p>We're moving to a new site -</p>
<p><a href="http://store.musicplace.com.au/">store.musicplace.com.au</a></p> </p>Update your bookmarks.</p>
</body></html>
<?php
}
ELSE
{
$new_URL = 'http://' . $server . '/' . $URL_map[$old_ID];
HEADER ("Status: HTTP/1.1 301 Moved Permanently");
HEADER ("Location: " . $new_URL);
}
?>
<p>Update your bookmarks.</p> part positioned way over to the right of the page, instead of on a separate line, I can see you copied that code before I had edited the post. You should read every post in this thread again just in case something has changed and you haven't seen the new version. IF ($URL_map[$old_ID] >=0 )
{
$new_URL = 'http://' . $server . '/' . $URL_map[$old_ID];
HEADER ("Status: HTTP/1.1 301 Moved Permanently");
HEADER ("Location: " . $new_URL);
}
ELSE
{
HEADER ("Status: HTTP/1.1 410 Gone");
?>
<html><head>
<title>Page Gone</title>
</head><body>
<h1>Page Not Found</h1>
<p>We have moved to our new site </p>
<p><a href="http://store.musicplace.com.au/">store.musicplace.com.au</a></p>
<p>Update your bookmarks.</p>
</body></html>
<?php
}
?>