Jump to content


  • Posts

  • Joined

  • Last visited

breckenridgej's Achievements


Newbie (1/14)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges



  1. I just discovered a problem with my solution (and in fact, with my entire .htaccess). URLs that do not match exactly on case are being directed to my 404 page. This includes my redirects for the URLs with query parameters and my static URLs. For example: http://www.somepage.com/page1.php?id=5323 is different than http://www.somepage.com/page1.php?ID=5323 This is particularly problematic because Google has indexed both versions of the URL. Is there an easy way to convert the URLs to all lower case before applying my other redirection rules including my PHP script? Thanks again. Jordan
  2. Thanks for all the tips. For posterity, this is what I did to get it to work: .htaccess: >RewriteEngine On RewriteBase / RewriteRule ^redirecturl1\.aspx$ redirect_script.php [QSA] RewriteRule ^redirecturl2\.aspx$ redirect_script.php [QSA] RewriteRule ^redirecturl3\.aspx$ redirect_script.php [QSA] redirect_script.php: ><?php $id= ( isset( $_GET['ID'] ) ) ? $_GET['ID']: ''; $site_url = 'http://www.xxxxxxxxx.com/'; $url_redirects = array( '1' => 'archives/URL1', '2' => 'archives/URL2', '6' => 'archives/URL3', '7' => 'archives/URL4', ); if ( $id== '' ) { Header ("HTTP/1.1 301 Moved Permanently"); Header('Location: '.$site_url.'index.php'); } else { $url = $site_url.$url_redirects[$id]; Header ("HTTP/1.1 301 Moved Permanently"); Header('Location: '.$url); } ?>
  3. Is there a special syntax for invoking the PHP script from with htaccess?
  4. It is a custom .Net application. I can use my migration scripts to create a detailed entry-level mapping of old name to new name, but you can ascertain the new names from the old URL. Jordan
  5. I've been googling for hours to no avail. I'm trying to redirect a series of dynamic URLs that are all unique to more static URLs as I complete a port to Movable Type. The mapping looks like this: (OLD) http://www.nomadicplanet.com/ImageDetails....&CurrentImage=3 (NEW) http://www.jordansphotos.com/archives/byEn..._sur_sunset.php After all my searching, I haven't been able to figure out how to put the dynamic URL with the question mark on the left side of a .htaccess redirect. Attempt #1: Redirect 301 /ImageDetails\.aspx\?GalleryId=53&CurrentImage=3 http://www.jordansphotos.com/archives/byEn..._sur_sunset.php Nor, have I been able to create a RewriteRule that takes the dynamic URL and maps it to the appropriate static URL. Attempt #2: RewriteEngine On RewriteBase / RewriteRule ^ImageDetails\.aspx\?GalleryId\=53\&CurrentImage\=3$ archives/byEntry/galleries/destinations/usa/central_california_coast/20040124_big_sur_sunset.php [R=301,L] The other question I have is that I have about 1100 of these. And, given they are all different, is this going to be a performance problem? I was trying to avoid search engine penalties by not losing the URLs but if its going to be too difficult I could also just redirect the ImageDetails.aspx file back to the Index or something. Would appreciate any suggestions! Jordan Breckenridge
  • Create New...