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. Technical SEO Issues
    4. How to skip all rewrite rules

    How to skip all rewrite rules

    Technical SEO Issues
    3 2 598
    • 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.
    • ChristopherGlaeser
      ChristopherGlaeser last edited by

      My web host account allows me to have multiple domain names.  Internally, the first domain is the main domain, and the additional domains are virtual domains, but externally, the intent is for each domain to appear as a unique domain.  When accessing a virtual domain, the server first processes the main .htaccess file, and then processes the .htaccess file for that virtual domain.  I'm sure this is a common setup, and this is not unique to my web host.

      Due the main .htaccess file, references to virtual.com are rewritten as main.com/virtual.  The web pages are displayed correctly, but of course, this rewrite is not what is desired.  What is the common solution?  For example, is there a conditional rewrite rule that says ignore the rest of the rewrite rules in this .htacces file?

      Best,
      Christopher

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

        Do you have access to edit the .htaccess file? If so I can see two possible solutions:

        1. There could be a wildcard in the .htaccess regex, meaning 'take all domains and then redirect to domain/virtual'. If you could change it to specifically process just your main domain, and not wildcard everything coming in that might work.

        2. .htaccess entries are executed in the order they're written, so if you have more specific directives you could put those 'above' whatever is handling the rewrites you're having a problem with. If you use the [L] tag I believe that tells the rule 'okay, stop processing after this one'.

        WARNING: If you don't understand it, messing with the .htaccess can mess things up! Especially if you change domain rules and then use the 'L' flag to exit processing, and then it skips directory/file rules further on down!

        Also, here's a StackOverflow article about conditional .htaccess rules:

        http://stackoverflow.com/questions/1035953/how-can-i-make-my-htaccess-skip-rules-conditionally

        ChristopherGlaeser 1 Reply Last reply Reply Quote 0
        • ChristopherGlaeser
          ChristopherGlaeser @icecarats last edited by

          Thanks for the quick response.  Yes, I have access to edit the .htaccess file.

          I'll try using the [L] tag for the virtual domains.

          Best,
          Christopher

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          • Magento Rewrite Issue
            Everett
            Everett
            0
            3
            88

          • Htaccess Rewrites
            Klement69
            Klement69
            0
            4
            316

          • Google Rewriting PDF Titles
            RyanKent
            RyanKent
            0
            4
            367

          • Htaccess rewrites
            AndrewAkesson
            AndrewAkesson
            0
            7
            705

          • How to properly abandon mod rewrite?
            Nick_Ker
            Nick_Ker
            0
            2
            649

          • URL Rewrite
            oznappies
            oznappies
            0
            4
            1.0k

          • Mod Rewrite Help
            DanHill
            DanHill
            0
            3
            879

          • URL Rewrite
            Gaveltek-173238
            Gaveltek-173238
            0
            13
            1.9k

          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