SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2009
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    .htaccess Files and Redundant Coding/Text

    Can someone clarify how many of these there should be? I seem to have one in my root folder and /wordpress folder also - which one is relevant, and which one should I make changes to should I ever need to?

    Second question - I believe I have residual code/text in there from past plugins such as Super Cache etc. but am not comfortable removing it, should I just create new files?

  2. #2
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,615
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by AmishPatel View Post
    Can someone clarify how many of these there should be? I seem to have one in my root folder and /wordpress folder also - which one is relevant, and which one should I make changes to should I ever need to?
    You really only need one in the root directory of your website unless specifically necessary for subdirectories with special purposes (ie, hosting other specific webapps, or for password-protecting specific directories, or to override something in the main htaccess file). When you start getting more than that, things start to get confusing and it's hard to tell what is overriding what.

    Second question - I believe I have residual code/text in there from past plugins such as Super Cache etc. but am not comfortable removing it, should I just create new files?
    Make a backup of the file (maybe rename it .htaccess.bak), take out the portions of code that you don't want in the live htaccess file, and test your site to make sure nothing breaks. If it works, great, if not, you'll have to investigate further. You are welcome to post your htaccess file for others to review.
    Last edited by ScallioXTX; Dec 26, 2013 at 13:57. Reason: fixed quote
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •