We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4080
    • 139 Posts
    I see that there’s a bunch of other threads on this topic but it looks like they’re past the 45 day mark. I’m having very little luck using the suggested RewriteRule solution. Below is my full htaccess code and I’m trying to do the redirects on the very bottom two lines. The last one (administration) seems to work if it’s alone without the one above it. The one above it (contactform) doesn’t seem to work no matter what I do. Please help! Thank you much in advance.

    # For full documentation and other suggested options, please see
    # http://svn.modxcms.com/docs/display/MODx096/Friendly+URL+Solutions
    # including for unexpected logouts in multi-server/cloud environments
    # and especially for the first three commented out rules
    
    #php_flag register_globals Off
    #AddDefaultCharset utf-8
    #php_value date.timezone Europe/Moscow
    
    # For security reasons, Option followsymlinks cannot be overridden.
    #Options +FollowSymlinks
    Options +SymLinksIfOwnerMatch
    RewriteEngine On
    RewriteBase /
    
    # Fix Apache internal dummy connections from breaking [(site_url)] cache
    RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
    RewriteRule .* - [F,L]
    
    # Rewrite domain.com -> www.domain.com -- used with SEO Strict URLs plugin
    #RewriteCond %{HTTP_HOST} .
    #RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
    #RewriteRule (.*) http://www.example.com/$1 [R=301,L]
    
    # Exclude /assets and /manager directories and images from rewrite rules
    RewriteRule ^(manager|assets)/*$ - [L]
    RewriteRule \.(jpg|jpeg|png|gif|ico)$ - [L]
    
    # For Friendly URLs
    RewriteRule ^en_US/home\.html http://www.thefrenchacademy.org/index.php [L,NC,R=301]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    
    # Reduce server overhead by enabling output compression if supported.
    #php_flag zlib.output_compression On
    #php_value zlib.output_compression_level 5
    
    # Redirect famn.org domain (all URLS) to thefrenchacademy.org
    RewriteCond %{HTTP_HOST} ^famn\.org$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.famn\.org$
    RewriteRule (.*) http://www.thefrenchacademy.org/$1 [R=301,L]
    
    RewriteRule ^en_US/contactform\.html$ /contact/ [L,NE,R=301]
    RewriteRule ^en_US/about_fam/administration\.html$ /administration/ [L,NE,R=301]
      • 4080
      • 139 Posts
      Ok so I wanted to post a follow-up since I got it to work (for the most part at least). All redirects in the htaccess code below under "# 301 Redirects for indexed URLs from old site" work except for the ones toward the bottom that start with "index.php?page="—which as you’d suspect go to the home page of the new MODx site. Not ideal but at least they go somewhere from the SERP. On that note, if anyone reading this knows how to fix these remaining redirects please chime in! I’m assuming it’s a syntax thing with htaccess and I’m definitely a novice when it comes to htaccess. At any rate, hopefully this post helps some other people in the same situation.
      # For full documentation and other suggested options, please see
      # http://svn.modxcms.com/docs/display/MODx096/Friendly+URL+Solutions
      # including for unexpected logouts in multi-server/cloud environments
      # and especially for the first three commented out rules
      
      #php_flag register_globals Off
      #AddDefaultCharset utf-8
      #php_value date.timezone Europe/Moscow
      
      # For security reasons, Option followsymlinks cannot be overridden.
      #Options +FollowSymlinks
      Options +SymLinksIfOwnerMatch
      RewriteEngine On
      RewriteBase /
      
      # Fix Apache internal dummy connections from breaking [(site_url)] cache
      RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
      RewriteRule .* - [F,L]
      
      # Rewrite domain.com -> www.domain.com -- used with SEO Strict URLs plugin
      #RewriteCond %{HTTP_HOST} .
      #RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
      #RewriteRule (.*) http://www.example.com/$1 [R=301,L]
      
      # Exclude /assets and /manager directories and images from rewrite rules
      RewriteRule ^(manager|assets)/*$ - [L]
      RewriteRule \.(jpg|jpeg|png|gif|ico)$ - [L]
      
      
      # 301 Redirects for indexed URLs from old site
      
      RewriteRule ^en_US/contactform.html http://www.thefrenchacademy.org/contact/ [L,NC,R=301]
      RewriteRule ^en_US/about_fam/administration.html http://www.thefrenchacademy.org/administration/ [L,NC,R=301]
      RewriteRule ^en_US/immersion/ressources.html http://www.thefrenchacademy.org/why-immersion-resources-and-links/ [L,NC,R=301]
      RewriteRule ^en_US/about_fam/testimonials.html http://www.thefrenchacademy.org/testimonials/ [L,NC,R=301]
      RewriteRule ^en_US/about_fam/philosophy.html http://www.thefrenchacademy.org/philosophy/ [L,NC,R=301]
      RewriteRule ^en_US/about_fam/press-releases.html http://www.thefrenchacademy.org/news/ [L,NC,R=301]
      RewriteRule ^en_US/news.html http://www.thefrenchacademy.org/news/ [L,NC,R=301]
      RewriteRule ^en_US/immersion/faq.html http://www.thefrenchacademy.org/why-immersion-faqs/ [L,NC,R=301]
      RewriteRule ^en_US/about_fam/parent_community.html http://www.thefrenchacademy.org/parents-community/ [L,NC,R=301]
      RewriteRule ^en_US/elementary/staff_el.html http://www.thefrenchacademy.org/french-elementary-school-staff/ [L,NC,R=301]
      RewriteRule ^en_US/immersion/benefits.html http://www.thefrenchacademy.org/why-immersion-benefits/ [L,NC,R=301]
      RewriteRule ^en_US/about_fam/after_school_activities.html http://www.thefrenchacademy.org/french-elementary-after-school-activites/ [L,NC,R=301]
      RewriteRule ^en_US/about_fam/schedule.html http://www.thefrenchacademy.org/french-elementary-school-daily-schedule/ [L,NC,R=301]
      RewriteRule ^en_US/admission/application.html http://www.thefrenchacademy.org/admission-application/ [L,NC,R=301]
      RewriteRule ^en_US/about_fam/links.html http://www.thefrenchacademy.org/why-immersion-resources-and-links/ [L,NC,R=301]
      RewriteRule ^en_US/about_fam/curriculum.html http://www.thefrenchacademy.org/french-elementary-school-curriculum-and-classes/ [L,NC,R=301]
      RewriteRule ^en_US/about_fam/employment.html http://www.thefrenchacademy.org/employment/ [L,NC,R=301]
      RewriteRule ^en_US/elementary/classes_el.html http://www.thefrenchacademy.org/french-elementary-school-curriculum-and-classes/ [L,NC,R=301]
      RewriteRule ^en_US/preschool/classes_mat.html http://www.thefrenchacademy.org/french-preschool-curriculum-and-classes/ [L,NC,R=301]
      RewriteRule ^en_US/admission/process.html http://www.thefrenchacademy.org/admission-process/ [L,NC,R=301]
      RewriteRule ^en_US/about_fam http://www.thefrenchacademy.org/about-us/ [L,NC,R=301]
      RewriteRule ^en_US/admission/tuitions.html http://www.thefrenchacademy.org/admission-tuition/ [L,NC,R=301]
      RewriteRule ^en_US/immersion/why-french.html http://www.thefrenchacademy.org/why-immersion/ [L,NC,R=301]
      RewriteRule ^en_US/news/27/82/Unexpected-visit.html http://www.thefrenchacademy.org/unexpected-visit/ [L,NC,R=301]
      RewriteRule ^en_US/news/21/82/Enrollment-2010-2011.html http://www.thefrenchacademy.org/now-accepting-applications/ [L,NC,R=301]
      
      RewriteRule ^fr_FR/about_fam/administration.html http://www.thefrenchacademy.org/administration-fr/ [L,NC,R=301]
      RewriteRule ^fr_FR/contactform.html http://www.thefrenchacademy.org/contact-fr/ [L,NC,R=301]
      RewriteRule ^fr_FR/immersion.html http://www.thefrenchacademy.org/pourquoi-limmersion/ [L,NC,R=301]
      RewriteRule ^fr_FR/application.html http://www.thefrenchacademy.org/dossier-dinscription/ [L,NC,R=301]
      RewriteRule ^fr_FR/admission/process.html http://www.thefrenchacademy.org/processus/ [L,NC,R=301]
      RewriteRule ^fr_FR/about_fam http://www.thefrenchacademy.org/a-propos-de-nous/ [L,NC,R=301]
      RewriteRule ^fr_FR/about_fam/press-releases.html http://www.thefrenchacademy.org/nouvelles/ [L,NC,R=301]
      RewriteRule ^fr_FR/about_fam/parent_community.html http://www.thefrenchacademy.org/communaute-des-parents/ [L,NC,R=301]
      RewriteRule ^fr_FR/about_fam/links.html http://www.thefrenchacademy.org/ressources-pour-limmersion-et-liens/ [L,NC,R=301]
      RewriteRule ^fr_FR/about_fam/curriculum.html http://www.thefrenchacademy.org/ecole-elementaire-programme-et-les-classes/ [L,NC,R=301]
      RewriteRule ^fr_FR/immersion/faq.html http://www.thefrenchacademy.org/foire-aux-questions/ [L,NC,R=301]
      RewriteRule ^fr_FR/preschool/classes_mat.html http://www.thefrenchacademy.org/la-maternelle-programme-et-les-classes/ [L,NC,R=301]
      RewriteRule ^fr_FR/immersion/why-french.html http://www.thefrenchacademy.org/pourquoi-limmersion/ [L,NC,R=301]
      RewriteRule ^fr_FR/about_fam/philosophy.html http://www.thefrenchacademy.org/philosophie/ [L,NC,R=301]
      RewriteRule ^fr_FR/about_fam/testimonials.html http://www.thefrenchacademy.org/temoignages/ [L,NC,R=301]
      RewriteRule ^fr_FR/admission/application.html http://www.thefrenchacademy.org/dossier-dinscription/ [L,NC,R=301]
      RewriteRule ^fr_FR/news/3/82/New-website.html http://www.thefrenchacademy.org/nous-allons-de-cet-ete/ [L,NC,R=301]
      RewriteRule ^fr_FR/home.html http://www.thefrenchacademy.org/accueil/ [L,NC,R=301]
      RewriteRule ^fr_FR/elementary/classes_el.html http://www.thefrenchacademy.org/ecole-elementaire-emploi-du-temps-quotidien/ [L,NC,R=301]
      
      RewriteRule ^index.php?page=links&hl=en_US http://www.thefrenchacademy.org/why-immersion-resources-and-links/ [L,NC,R=301]
      RewriteRule ^index.php?page=employment&hl=en_US http://www.thefrenchacademy.org/employment/ [L,NC,R=301]
      RewriteRule ^index.php?page=ressources&hl=fr_FR http://www.thefrenchacademy.org/ressources-pour-limmersion-et-liens/ [L,NC,R=301]
      RewriteRule ^index.php?page=press-releases&hl=en_US http://www.thefrenchacademy.org/news/ [L,NC,R=301]
      RewriteRule ^index.php?page=process&hl=en_US http://www.thefrenchacademy.org/admission-process/ [L,NC,R=301]
      RewriteRule ^index.php?page=faq&hl=fr_FR http://www.thefrenchacademy.org/foire-aux-questions/ [L,NC,R=301]
      RewriteRule ^index.php?page=administration&hl=fr_FR http://www.thefrenchacademy.org/administration-fr/ [L,NC,R=301]
      RewriteRule ^index.php?page=press-releases&hl=fr_FR http://www.thefrenchacademy.org/nouvelles/ [L,NC,R=301]
      RewriteRule ^index.php?page=contactform&hl=fr_FR http://www.thefrenchacademy.org/contact-fr/ [L,NC,R=301]
      
      
      # For Friendly URLs
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
      
      # Reduce server overhead by enabling output compression if supported.
      #php_flag zlib.output_compression On
      #php_value zlib.output_compression_level 5
      
      # Redirect famn.org domain (all URLS) to thefrenchacademy.org
      RewriteCond %{HTTP_HOST} ^famn\.org$ [OR]
      RewriteCond %{HTTP_HOST} ^www\.famn\.org$
      RewriteRule (.*) http://www.thefrenchacademy.org/$1 [R=301,L]