XtrmAddons.Com > Extensions MVC - Web Development

Differents sections of the site

PHP Release

MySQL News

Create .htaccess file: Tips & Tricks

.htaccess files under Apache can add or modify configuration elements of the HTTP server to a directory as the files and subdirectories it contains.
Among the most common uses of a file .htaccess we can mention:
  • Directory access management.
  • Redirection management.
  • url rewriting
  • And many other ...
.htaccess files are invisible and inaccessible to visitors and can be nested in the tree site.

Example of directory tree and .htaccess

Example of directory tree and .htaccess Nesting .htaccess files allow to define custom settings on multiple levels of directories depending on the architecture of the site.

Important
Directory protection applies to the protected directory and any contents.

.htaccess file creation under Unix/Linux

Under Unix/Linux environment, create a file with a name like .htaccess does not cause any particular concern and is the same way as any other text file.

To create an empty file in the shell. In the directory you want, enter the command:
touch .htaccess

.htaccess file creation under Windows

An old legend says that it is not possible to create a "no name" file on Windows. The files are defined as follows: file_name.extension, but, a .htaccess file for some text editors under Windows, when it recorded, will be interpreted as having only extension, wether a mistake of the user.
Softwares like Eclispe, for example, allow the creation of such files without any special handling.
To create a file with Notepad or Wordpad for example:
  • Open Notepad or Wordpad
  • Click on Save as...
  • Enter ".htaccess" (well mention the quotes because that is what permit to save the desired file name) then click on Save.

Secure access to a .htaccess file on Unix/Linux, CHMOD

With operating systems Unix / Linux comes a function chmod that allow to manage restrictions on access directories and files based on user level, public, groupe or owner the actions read, write et execute.
In order to best protect access to your .htaccess file, must be given all rights to its owner and allow read-only for public and group.

In the directory where your .htaccess file enter the command:
chmod 644 .htaccess

Secure access to a .htaccess file on Windows, NTFS

On Windows, the system of protection of files and directories differs from that used by Unix/Linux. There is no function chmod. In most cases you can spend step protection of the .htaccess file.
However, if you want to know more about protecting files with Windows, please see the following article: permissions ntfs or tool to modify NTFS permissions Xcacls.vbs.

Secure access to a .htaccess file on Unix/Linux, FileZilla

filezilla htaccess menu contextuel filezilla htaccess permissions You create a .htaccess file on Windows and after FTP upload at your host Unix/Linux you want to change the permissions for your file.
Here's what to do with FileZilla:

Access to a invisible .htaccess with FileZilla

filezilla htaccess invisible It is possible that some hosts or some directories, the .htaccess file is not visible from the list of files in FileZilla. To enable access to these files, simply forcing the display of hidden files.

XtrmAddons.Com > News & Feeds

All web news

Apache Foundation

  • Demand for best-in-class Open Source solutions drives landmark achievements Forest Hill, MD -–16 May 2012-– The Apache Software Foundation (ASF), developers, stewards, and incubators of nearly 150 Open Source projects and initiatives, today announced key milestones achieved in the first quarter of 2012. Recognized as one...

  • Easy to use, affordable, and over 300% faster, Open Source Java Enterprise Edition of popular Apache Tomcat application server ideally suited for Cloud environments The Apache Software Foundation (ASF), the all-volunteer developers, stewards, and incubators of nearly 150 Open Source projects...

  • High-performance, fault-tolerant Open Source "Big Data"  powerhouse scales petabytes of data at Adobe, Cisco, IBM, Morningstar, Netflix, PBS, Rackspace, Twitter, US Government, and more.  Forest Hill, MD –24 April 2012– The Apache Software Foundation (ASF), the all-volunteer developers, stewards, and...

  • The Apache Software Foundation (ASF) welcomes Citrix to the roster of sponsors at the Platinum level. "We are pleased to welcome Citrix to our individual and corporate sponsors whose generosity helps advance the day-to-day operations of The Apache Software Foundation," said...

  • Open Source big data tool used for efficient bulk transfer between Apache Hadoop and structured datastores. Forest Hill, MD --The Apache Software Foundation (ASF), the all-volunteer developers, stewards, and incubators of nearly 150 Open Source projects and initiatives, today announced that Apache Sqoop has graduated...

  • Open Source mashup platform provides easy-to-use infrastructure for building and integrating with social media standards including Activity Streams, OpenSocial, W3C Widgets, and more.  Forest Hill, MD -- The Apache Software Foundation (ASF), the all-volunteer developers, stewards, and incubators of nearly 150 Open Source projects...

XtrmAddons.Com > Statistiques and Informations

Site informations

Domain name

We trust 1&1 for our domains - Reserve yours now for only 6.99€ HT (8.36€) per year!

Statistics

Visitors
16
Articles
32
Web Links
9
Articles View Hits
4710

Who's online ?

We have 3 guests and no members online