The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. White Hat / Black Hat SEO
    4. Problems in 301 redirections

    Problems in 301 redirections

    White Hat / Black Hat SEO
    4 3 99
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • esiow2013
      esiow2013 last edited by

      Hi guys,

      I just redirected the following URLs to one landing page (under a new domain):

      Old URLs

      http://www.olddomain.com/folder/page/1

      http://www.olddomain.com/folder/page/2

      http://www.olddomain.com/folder/page/3

      http://www.olddomain.com/folder/page/4

      http://www.olddomain.com/folder/page/5

      http://www.olddomain.com/folder/page/6

      New URL

      http://www.newdomain.com/new-folder/new-page

      Here's the code in .htaccess that I'm currently using:

      RedirectMatch 301 /folder/page/(.*) http://www.newdomain.com/new-folder/new-page

      The redirection rules are working well but the landing pages are showing special parameters like the following:

      http://www.olddomain.com/folder/page/1 TO http://www.newdomain/new-folder/new-page?cmd=divisionsMain&group=2&country=1&category=1&page=1

      http://www.olddomain.com/folder/page/2 TO http://www.newdomain/new-folder/new-page?cmd=divisionsMain&group=2&country=1&category=1&page=2

      http://www.olddomain.com/folder/page/3 TO http://www.newdomain/new-folder/new-page?cmd=divisionsMain&group=2&country=1&category=1&page=3

      http://www.olddomain.com/folder/page/4 TO http://www.newdomain/new-folder/new-page?cmd=divisionsMain&group=2&country=1&category=1&page=4

      http://www.olddomain.com/folder/page/5 TO http://www.newdomain/new-folder/new-page?cmd=divisionsMain&group=2&country=1&category=1&page=5

      http://www.olddomain.com/folder/page/6 TO http://www.newdomain/new-folder/new-page?cmd=divisionsMain&group=2&country=1&category=1&page=6

      Here's what my .htaccess file look like:

      Options +FollowSymLinks
      RewriteEngine on

      #RewriteCond %{HTTP_HOST} ^beta|livescore.olddomain.com [NC]
      #RewriteRule ^(.) - [L]
      RewriteCond %{HTTP_HOST} !^www.olddomain.com [NC]
      RewriteRule ^(.
      )$ http://www.%{HTTP_HOST}/$1 [R=301,L]

      #--Landing pages -start
      RewriteRule ^apartment-for-rent-in-makati(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^apartment-for-sale-in-makati(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^for-rent-in-makati(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^for-sale-in-makati(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^apartment-for-rent-in-manila(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^apartment-for-sale-in-manila(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^serviced-apartments-ho-chi-minh-for-rent(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^residential-housing-bangkok(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^homes-for-sale(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^houses-for-sale(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^real-estate-listings(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^house-listings(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^rent-in-makati(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^manila-apartments(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^house-for-rent-manila(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^apartment-for-rent-in-saigon(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^apartment-for-rent-in-hcmc(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^house-for-rent-vietnam(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^house-for-rent-in-saigon(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^philippine-real-estate-for-sale(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^buy/houses/philippines/national-capital-region/makati/dasmarinas-village(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^buy/apartments/philippines/national-capital-region/makati(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^buy/apartments/philippines/national-capital-region/paranaque(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^buy/apartments/philippines/national-capital-region/taguig/fort-bonifacio-global-city(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^buy/condominiums/philippines/national-capital-region/makati(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^buy/condominiums/philippines/national-capital-region/taguig/fort-bonifacio-global-city(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^buy/houses/philippines/national-capital-region/makati(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^buy/houses/philippines/national-capital-region/muntinlupa(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^buy/houses/philippines/national-capital-region/pasig(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^buy/houses/philippines/national-capital-region/quezon-city(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^buy/office-spaces/philippines/national-capital-region/makati(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^rent/apartments/philippines/national-capital-region/makati(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^rent/commercial-spaces/philippines/national-capital-region/makati(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^rent/office-spaces/philippines/national-capital-region/makati(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^rent/condominiums/philippines/national-capital-region/makati(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^rent/condominiums/philippines/national-capital-region/taguig/fort-bonifacio-global-city(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^rent/houses/philippines/national-capital-region/muntinlupa(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^rent/houses/philippines/national-capital-region/pasig(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^rent/industrial_warehouses/philippines/national-capital-region/makati(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^rent/industrial_warehouses/philippines/national-capital-region/mandaluyong(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^rent/land_developments/philippines/national-capital-region/taguig/fort-bonifacio-global-city(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^buy/pre-selling_project-sales/philippines/national-capital-region/makati(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^rent/office-spaces/philippines/national-capital-region/pasig/ortigas(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^rent/office-spaces/philippines/national-capital-region/taguig/fort-bonifacio-global-city(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      RewriteRule ^buy/pre-selling_project-sales/philippines/national-capital-region/taguig/fort-bonifacio-global-city(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=seoModule&sort=$2&page=$5 [L]
      #--Landing pages -end

      #--Redirect pages -start
      RewriteRule ^apartment-for-rent-philippines$ /rent/apartments/philippines [R=301,L]
      RewriteRule ^serviced-apartments-ho-chi-minh-for-rent$ /rent/serviced-apartments/vietnam/south/ho-chi-minh-city [R=301,L]
      RewriteRule ^rent/apartments/vietnam/ho-chi-minh-city/serviced-apartment-for-rent-in-Ho-Chi-Minh-City$ /rent/serviced-apartments/vietnam/south/ho-chi-minh-city [R=301,L]
      RewriteRule ^apartment-for-rent-in-saigon$ /rent/apartments/vietnam/south/ho-chi-minh-city [R=301,L]
      RewriteRule ^rent/apartments/vietnam/ho-chi-minh-city/apartment-for-rent-in-Saigon$ /rent/apartments/vietnam/south/ho-chi-minh-city [R=301,L]
      RewriteRule ^philippine-real-estate-for-sale$ /residential-properties [R=301,L]
      RewriteRule ^house-for-rent-in-saigon$ /rent/houses/vietnam/south/ho-chi-minh-city [R=301,L]
      RewriteRule ^house-for-rent-vietnam$ /rent/villas/vietnam [R=301,L]
      RewriteRule ^condo-for-rent-philippines$ /rent/condominiums/philippines [R=301,L]
      RewriteRule ^makati-condominiums$ /buy/condominiums/philippines/national-capital-region/makati [R=301,L]
      RewriteRule ^apartment-for-rent-in-hcmc$ /rent/apartments/vietnam/south/ho-chi-minh-city [R=301,L]
      RewriteRule ^apartment-for-rent-in-saigon$ /rent/apartments/vietnam/south/ho-chi-minh-city [R=301,L]
      RewriteRule ^house-for-rent-manila$ /rent/houses/philippines/national-capital-region/manila [R=301,L]
      RewriteRule ^manila-apartments$ /rent/apartments/philippines/national-capital-region/manila [R=301,L]
      RewriteRule ^rent-in-makati$ /rent/apartments/philippines/national-capital-region/makati [R=301,L]
      RewriteRule ^house-listings$ /residential-properties [R=301,L]
      RewriteRule ^real-estate-listings$ /residential-properties [R=301,L]
      RewriteRule ^houses-for-sale$ /residential-properties [R=301,L]
      RewriteRule ^homes-for-sale$ /residential-properties [R=301,L]
      RewriteRule ^residential-housing-bangkok$ /buy/houses/thailand/central/bangkok [R=301,L]
      RewriteRule ^hcmc-apartment-rent$ /rent/apartments/vietnam/south/ho-chi-minh-city [R=301,L]
      RewriteRule ^serviced-apartments-ho-chi-minh-for-rent$ /rent/serviced-apartments/vietnam/south/ho-chi-minh-city [R=301,L]
      RewriteRule ^saigon-apartment-rent$ /rent/apartments/vietnam/south/ho-chi-minh-city [R=301,L]
      RewriteRule ^apartment-for-sale-in-manila$ /buy/apartments/philippines/national-capital-region/manila [R=301,L]
      RewriteRule ^apartment-for-rent-in-manila$ /rent/apartments/philippines/national-capital-region/manila [R=301,L]
      RewriteRule ^for-sale-in-makati$ /buy/houses/philippines/national-capital-region/makati [R=301,L]
      RewriteRule ^for-rent-in-makati$ /rent/houses/philippines/national-capital-region/makati [R=301,L]
      RewriteRule ^apartment-for-sale-in-makati$ /buy/apartments/philippines/national-capital-region/makati [R=301,L]
      RewriteRule ^apartment-for-rent-in-makati$ /rent/apartments/philippines/national-capital-region/makati [R=301,L]
      RewriteRule ^rent/villas/vietnam/ho-chi-minh-city/house-for-rent-in-saigon$ /rent/houses/vietnam/south/ho-chi-minh-city [R=301,L]
      #--Redirect pages -end

      #--custom landing pages from Ramon -start | Rnel
      #--13-Mar-2012
      RewriteRule ^rent/(apartments|villas)/vietnam/ho-chi-minh-city/([a-zA-Z-]+)-for-rent-in-([a-zA-Z-]+)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=1&country=vietnam&group=1&custom_category=$2&custom_area=$3&custom_city=25443&custom=1&page=$6 [L]
      RewriteRule ^rent/vietnam/ho-chi-minh-city/district-1/ho-chi-minh-city-(district-1|real-estate)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=1&country=vietnam&group=1&custom_target=$1&custom_city=25443&custom=2&page=$4 [L]
      RewriteRule ^rent/apartments/vietnam/ho-chi-minh-city/saigon-pearl-(apartment-for-rent|for-rent)((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=1&country=vietnam&group=1&custom_target=$1&custom_city=25443&custom=3&page=$6 [L]

      #-24-April-2012 | Apartment for rent in makati | 08-May-2012 changed to apartment-for-rent-in-makati
      #RewriteRule ^rent/apartments/philippines/national-capital-region/makati((/)([0-9]+))?$ /rent/apartments/philippines/national-capital-region/apartment-for-rent-in-makati$1 [R=301]
      #RewriteRule ^rent/apartments/philippines/national-capital-region/apartment-for-rent-in-makati((/)([0-9]+))?$ index.php?cmd=divisionsMain&group=1&country=philippines®ion=national-capital-region&city=makati&category=apartments&page=$3 [L]
      #RewriteRule ^rent/apartments/philippines/national-capital-region/makati((/)([0-9]+))?$ /apartment-for-rent-in-makati$1 [R=301]
      #RewriteRule ^buy/apartments/philippines/national-capital-region/makati((/)([0-9]+))?$ /apartment-for-sale-in-makati$1 [R=301]
      #RewriteRule ^rent/apartments/philippines/national-capital-region/apartment-for-rent-in-makati((/)([0-9]+))?$ /apartment-for-rent-in-makati$1 [R=301]
      #RewriteRule ^apartment-for-rent-in-makati(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=divisionsMain&group=1&country=philippines®ion=national-capital-region&city=makati&category=apartments&page=$5&sort=$2 [L]
      #RewriteRule ^apartment-for-sale-in-makati(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=divisionsMain&group=2&country=philippines®ion=national-capital-region&city=makati&category=apartments&page=$5&sort=$2 [L]

      #--03-May-2012 - Manila | 07-May-2012 - Makati | (rent|buy)/
      #RewriteRule ^rent/apartment-for-rent-in-manila$ /apartment-for-rent-in-manila [R=301]
      #RewriteRule ^(apartment-)?for-(rent|sale)-in-(manila|makati)(/sort-([a-z0-9-]+))?((/)([0-9]+))?$ index.php?cmd=divisionsMain&mainDivision=1&country=philippines&group_name=$2&custom_target=&custom_region=1&custom_city=$3&custom=4&page=$8&sort=$5 [L]
      #--custom landing pages from Ramon|Claudio -end

      November 26 2013 - migration testing from olddomain to newdomain

      RedirectMatch 301 /folder/page/(.*) http://www.newdomain.com/new-folder/new-page

      End

      <files 403.shtml="">order allow,deny
      allow from all</files>

      deny from 173.245.84.49
      deny from 92.40.44.99
      deny from 92.41.197.133
      deny from 41.58.53.131
      deny from 41.184.129.141
      deny from 112.135.153.58
      deny from 41.138.169.191
      deny from 41.58.19.87
      deny from 199.58.164.113
      deny from 41.71.158.188
      deny from 81.149.227.17
      deny from 95.211.231.222
      deny from 41.58.196.39

      Do you guys know why the landing pages are showing special parameters though I didn't add anything in the 301 redirection rules?

      1 Reply Last reply Reply Quote 0
      • seom2014
        seom2014 last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • BlueprintMarketing
          BlueprintMarketing last edited by

          Use one the the two tools

          http://seo-website-designer.com/HtAccess-301-Redirect-Generator

          Underneath the generated code box you will see a line that says

          "Here's an overview on what it does"

          this will explain to you how to simply and move the ? strange parameter issue.

          or

          You may also want to make some redirects with this tool.

          http://www.htaccessredirect.net/

          All the best,

          Thomas

          1 Reply Last reply Reply Quote 1
          • esiow2013
            esiow2013 last edited by

            Thanks for sharing the links Thomas! I'll check these tools right away. 🙂

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            • 301 Redirect Backlinks from Forbes,CNN.
              Hardcoretech
              Hardcoretech
              0
              7
              522

            • How to redirect 301 from high authority sites to own website?
              Ademirates
              Ademirates
              0
              3
              69

            • Deleting 301 Redirect URLs from the CMS
              KevinBudzynski
              KevinBudzynski
              0
              4
              80

            • Best 301 redirection plugin for Wordpress?
              ChristopherGlaeser
              ChristopherGlaeser
              1
              2
              457

            • What is the difference between Redirect 301 and RedirectMatch 301 in .htaccess?
              Devanur-Rafi
              Devanur-Rafi
              0
              2
              12.9k

            • 301 Redirect Asp.net Help
              CityWonders
              CityWonders
              0
              2
              139

            • Does 301 redirection will effect my site in the future?
              NakulGoyal
              NakulGoyal
              0
              4
              383

            • New website :301 redirection of a established domain
              Marcus_Miller
              Marcus_Miller
              0
              4
              762

            Get started with Moz Pro!

            Unlock the power of advanced SEO tools and data-driven insights.

            Start my free trial
            Products
            • Moz Pro
            • Moz Local
            • Moz API
            • Moz Data
            • STAT
            • Product Updates
            Moz Solutions
            • SMB Solutions
            • Agency Solutions
            • Enterprise Solutions
            • Digital Marketers
            Free SEO Tools
            • Domain Authority Checker
            • Link Explorer
            • Keyword Explorer
            • Competitive Research
            • Brand Authority Checker
            • Local Citation Checker
            • MozBar Extension
            • MozCast
            Resources
            • Blog
            • SEO Learning Center
            • Help Hub
            • Beginner's Guide to SEO
            • How-to Guides
            • Moz Academy
            • API Docs
            About Moz
            • About
            • Team
            • Careers
            • Contact
            Why Moz
            • Case Studies
            • Testimonials
            Get Involved
            • Become an Affiliate
            • MozCon
            • Webinars
            • Practical Marketer Series
            • MozPod
            Connect with us

            Contact the Help team

            Join our newsletter
            Moz logo
            © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
            • Accessibility
            • Terms of Use
            • Privacy