We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7527
    • 437 Posts
    Hi,

    I have renamed my file to .htaccess and amended the paths for friendly URLS as follows:

    # or for the opposite domain.com -> www.domain.com use the following
    # DO NOT USE BOTH
    #
    RewriteCond %{HTTP_HOST} .
    RewriteCond %{HTTP_HOST} !^www\.pawsforwildlife\.co.uk [NC]
    RewriteRule (.*) http://www.pawsforwildlife.co.uk/$1 [R=301,L]
    
    
    
    # Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent 
    # https://www.domain.com when your cert only allows https://secure.domain.com
    #RewriteCond %{SERVER_PORT} !^443
    #RewriteRule (.*) https://example-domain-please-change.com/$1 [R=301,L]
    
    
    
    # The Friendly URLs part
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]


    But for some reason it throws all my template out? If I rename back to ht.access it comes back?
    Regards,
    DS

    This question has been answered by distant_smile. See the first response.

      www.PawsForWildlife.co.uk
      www.Borntobrick.co.uk
      • 38783
      • 571 Posts
      Hello

      Below is a default .htaccess file

      The Friendly URLs part
      You have uncommented the Friendly URLs part correctly.

      Rewrite domain.com -> www.domain.com
      You have also uncommented the lines that relate to domain.com --> www.domain.com
      This is to make sure that your url is http://www.pawsforwildlife.co.uk and that people who type in http://pawsforwildlife.co.uk are sent to http://www.pawsforwildlife.co.uk

      On this section you need to comment out the full stop in front of the 'uk' part of the url

      So that it reads
      RewriteCond %{HTTP_HOST} !^www\.pawsforwildlife\.co\.uk [NC]


      Base href
      I think there is a also problem with your base href. It reads:

      <base href="http://www.pawsforwildlife.co.uk//" />


      I think it should read:

      <base href="http://www.pawsforwildlife.co.uk/">




      RewriteEngine On
      RewriteBase /
      
      # Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin
      #RewriteCond %{HTTP_HOST} .
      #RewriteCond %{HTTP_HOST} !^example-domain-please-change\.com [NC]
      #RewriteRule (.*) http://example-domain-please-change.com/$1 [R=301,L]
      #
      # or for the opposite domain.com -> www.domain.com use the following
      # DO NOT USE BOTH
      #
      #RewriteCond %{HTTP_HOST} .
      #RewriteCond %{HTTP_HOST} !^www\.example-domain-please-change\.com [NC]
      #RewriteRule (.*) http://www.example-domain-please-change.com/$1 [R=301,L]
      
      # Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent 
      # https://www.domain.com when your cert only allows https://secure.domain.com
      #RewriteCond %{SERVER_PORT} !^443
      #RewriteRule (.*) https://example-domain-please-change.com/$1 [R=301,L]
      
      # The Friendly URLs part
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
      


        If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

        email: [email protected] | website: https://andytough.com
        • 7527
        • 437 Posts
        Ok I removed the extra '/' in the base href, and I changed the .htaccess:

        # or for the opposite domain.com -> www.domain.com use the following
        # DO NOT USE BOTH
        #
        RewriteCond %{HTTP_HOST} .
        RewriteCond %{HTTP_HOST} !^www\.pawsforwildlife\.co\.uk [NC]
        RewriteRule (.*) http://www.pawsforwildlife.co.uk/$1 [R=301,L]
         
         
         
        # Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent 
        # https://www.domain.com when your cert only allows https://secure.domain.com
        #RewriteCond %{SERVER_PORT} !^443
        #RewriteRule (.*) https://example-domain-please-change.com/$1 [R=301,L]
         
         
         
        # The Friendly URLs part
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]


        Yet still my page loads but the template and images don't. It's as if the .htaccess has affected all the paths for images/css/template, etc?
        [ed. note: distant_smile last edited this post 8 years, 2 months ago.]
          www.PawsForWildlife.co.uk
          www.Borntobrick.co.uk
          • 38783
          • 571 Posts
          What settings do you have for the following in the Friendly URLs section of the manager?

          Use Friendly URLs
          Use Strict Friendly URLs
          Use Friendly Alias Path

          Have you cleared the cache?
          Manage / Clear Cache
          and
          Manage / Refresh URIs
            If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

            email: [email protected] | website: https://andytough.com
          • discuss.answer
            • 7527
            • 437 Posts
            Never mind, silly mistake. My templates etc were in a folder 'Templates' but my paths said 'templates'. Did not matter before but when I switched to Friendly URLs it became case sensitive. Thank you for your replies
              www.PawsForWildlife.co.uk
              www.Borntobrick.co.uk
              • 38783
              • 571 Posts
              Glad you got it sorted.
                If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

                email: [email protected] | website: https://andytough.com