Prevent .htaccess file overwrite

Discussion in 'Setting-up protection' started by rnavarro, Feb 7, 2008.

  1. rnavarro

    rnavarro New Member

    Joined:
    Jan 31, 2008
    Messages:
    2
    Greetings,

    I have one of those video sharing scripts that i would like to protect using aMember Pro. However, the script makes extensive use of .htaccess file in order to function. When I tried to protect it using new_rewrite, it asks me to delete that file first. If I do, then my site won't function. Is there a way around this?

    Thanks in advanced for your help.
  2. davidm1

    davidm1 aMember User & Partner

    Joined:
    May 16, 2006
    Messages:
    4,437
    Protect a dummy directory with the same method. Open the .htaccess file created, copy, and add the contents to your current .htaccess you want to maintain.

    David
  3. rnavarro

    rnavarro New Member

    Joined:
    Jan 31, 2008
    Messages:
    2
    Thanks David. Will give that a try.
  4. getresults

    getresults Member

    Joined:
    Nov 1, 2006
    Messages:
    87
    Another great tip that I use...

    If you have multiple applications using data in the .htaccess file (amember + wordpress for example) then once you have the .htaccess file correctly set and working with the rewrite rules for all of the applications make a copy of it in the same directory with a useful name i.e.

    dot.htaccess.good.19feb2008

    That way you'll have a backup of the working .htaccess file just in case you accidentally delete it / one of the applications messes it up later.

    I generally rename them "dot.htaccess[something]" with the "dot" in front so that the file is visible all the time. .htaccess files are sometimes not shown by some FTP software or via a shell login.

Share This Page