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. Htaccess mod rewrite from server address

    Htaccess mod rewrite from server address

    Technical SEO Issues
    6 4 185
    • 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.
    • BlueTree_Sean
      BlueTree_Sean last edited by

      Hi there,

      I'm not massively experienced with creating mod rewrite rules and I'm worried I've got this wrong as its slightly different to what I'm used to.

      The web dev and content creators were working on http://5.10.105.45/~isea/ to create content.

      I want to redirect all URL's to www.iseasurfwear.co.uk. This is what I've written

      //Rewrite to www
      Options +FollowSymLinks
      RewriteEngine on
      RewriteCond %{HTTP_HOST} ^5.10.105.45/~isea/[nc]
      RewriteRule ^(.*)$ http://www.iseasurfwear.co.uk/$1 [r=301,nc]

      Can anyone tell me if this is correct?

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

        Just tested. It doesn't work. Any help?

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

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

            If you're moving from a dev environment to live, it's not redirects that you need. You need to update the references in the code of the template and in the content areas that your developers didn't clean up when moving the site to live. Doing rewrites will only cover the issue, but the incorrect links will still be there.

            BlueTree_Sean 1 Reply Last reply Reply Quote 0
            • BlueTree_Sean
              BlueTree_Sean @TheeDigital last edited by

              Agreed, but for now I just want to cover the issue so we can move forward. Slight update to my code. This rewrites the homepage, but doesn't seem to be rewriting anything else. Any tips?

              Options +FollowSymlinks
              RewriteEngine on
              rewritecond %{http_host} ^5.10.105.45/~isea/ [nc]
              rewriterule ^(.*)$ http://www.mydomain.com/$1 [r=301,nc]

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

                Try

                RewriteEngine On
                RewriteCond %{HTTP_HOST} ^5.10.105.45/~isea/
                RewriteRule ^(.*)$ http://www.NewDomain.com/$1 [R=301,L]

                Or

                RewriteEngine On
                RewriteCond %{HTTP_HOST} /~isea/$
                RewriteRule ^(.*)$ http://www.NewDomain.com/$1 [R=301,L]

                ** (edit) Make sure your sever has Mod Rewrite Enabled*

                1 Reply Last reply Reply Quote 2
                • 1 / 1
                • First post
                  Last post
                • Page for page 301 redirects from old server to new server
                  cindyt-17038
                  cindyt-17038
                  0
                  5
                  398

                • We are using Hotlink Protection on our server for jpg mostly. What is moz.com address to allow crawl access?
                  Peterli
                  Peterli
                  0
                  2
                  135

                • Subdomain hosted on a different server VS Subfolder on main server
                  NakulGoyal
                  NakulGoyal
                  0
                  2
                  124

                • Duplicate Page Titles Warnings, htaccess Rewrite & Canonical Links.
                  Webdeal
                  Webdeal
                  0
                  2
                  276

                • Duplicate Content - Home Page even wth Mod Rewrite 301
                  Titan552
                  Titan552
                  0
                  4
                  1.0k

                • Moved to a New Server IP Address
                  Dr-Pete
                  Dr-Pete
                  0
                  7
                  1.5k

                • On a dedicated server with multiple IP addresses, how can one address group be slow/time out and all other IP addresses OK?
                  RobertFisher
                  RobertFisher
                  0
                  6
                  2.5k

                • Redirects on Window Servers - .htaccess equivalent for IIS
                  Getz.pro
                  Getz.pro
                  0
                  2
                  4.1k

                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