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. Intermediate & Advanced SEO
    4. Modify .htaccess

    Modify .htaccess

    Intermediate & Advanced SEO
    10 5 466
    • 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.
    • SilbertAd
      SilbertAd last edited by

      Hi everybody,

      I need to modify the .htaccess in order to include a 301 redirect.

      But I am having some problems with this.

      I downloaded the file into my computer and then modified it with windows notepad, but when I upload it again to the server it is not working and turns down my website.

      Even if I do not change anything on it. So I guess there is a problem in the saving process.

      Any Idea or suggestion?

      Thanks,

      G.

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

        Can you post the content of the htaccess here so we can have a look ?

        SilbertAd 1 Reply Last reply Reply Quote 0
        • AlanMosley
          AlanMosley last edited by

          i work with windows server not linux, but i would say it is the encoding, try saving it wirth different ecoding

          Try saving as UTF-8 or ASCII, you can do this on the save as dialog box

          SilbertAd 1 Reply Last reply Reply Quote 2
          • SilbertAd
            SilbertAd @eyepaq last edited by

            Is it safe to post all the content over here?

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

              Yes, it's safe - don't see a reason why that can be an issue.

              Also take Alan's advice - maybe you are saving it a different format and that can also be an issue.

              SilbertAd 1 Reply Last reply Reply Quote 0
              • SilbertAd
                SilbertAd @AlanMosley last edited by

                Perfect Alan! it worked.

                Thank you very much!!

                AlanMosley Highland 2 Replies Last reply Reply Quote 0
                • SilbertAd
                  SilbertAd @eyepaq last edited by

                  It was that!

                  Thank you!

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

                    Assuming it's not actually an issue with the code in the .htaccess file, it's probably something like Alan says, an encoding issue.  It might also be the FTP upload method you're using to the server as well borking something in the file (i.e. FTP transfer type setting in your FTP client - try forcing the setting to "ASCII" rather than automatic or binary), or possibly a permissions issue on the file when it's uploaded, though that seems unlikely.

                    If you can edit in place on the server (using ssh and an editor like vim) then that would rule out those kind of problems.

                    1 Reply Last reply Reply Quote 0
                    • AlanMosley
                      AlanMosley @SilbertAd last edited by

                      no worries, also for the future FTP programs can alter the encoding also.

                      1 Reply Last reply Reply Quote 0
                      • Highland
                        Highland @SilbertAd last edited by

                        I highly recommend Notepad++ for that reason. Better control over the line return problems. Windows Notepad leaves much to be desired in this area.

                        1 Reply Last reply Reply Quote 0
                        • 1 / 1
                        • First post
                          Last post
                        • Htaccess redirect veriables
                          NoisyLittleMonkey
                          NoisyLittleMonkey
                          0
                          3
                          96

                        • Redirects in .htaccess file
                          Rebeca1
                          Rebeca1
                          0
                          3
                          86

                        • Best .htaccess guides in your bookmark?
                          LynnPatchett
                          LynnPatchett
                          0
                          4
                          234

                        • Quick htaccess question
                          Modi
                          Modi
                          0
                          3
                          130

                        • .htaccess newby
                          GlobalLingo
                          GlobalLingo
                          0
                          16
                          334

                        • .htaccess files
                          JamesFx
                          JamesFx
                          0
                          4
                          294

                        • How to fix a canonical problem with no htaccess?
                          bronxpad
                          bronxpad
                          0
                          3
                          757

                        • .htaccess code ?
                          Marcus_Miller
                          Marcus_Miller
                          0
                          2
                          485

                        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