I'm developing a website using xampp on my Windows computer. But when I try to rename the file
.htaccess in order to enable rewrite rules in Joomla, I get an error message:
How can I rename this file?
Joomla Stack Exchange is a question and answer site for Joomla! administrators, users, developers and designers. It only takes a minute to sign up.Sign up to join this community
In Windows Explorer, the path of least resistance is to select the file then press
F2 to rename it (or right-click and choose Rename), then rename to:
Notice the trailing dot (
.), make sure you add that too. Hit enter and confirm that you want to rename the file and voila:
(I have a monkey head icon because I've got Helicon Tech's APE installed.)
Most of the Windows standard "Save As" dialogues will also let you save files named with a leading period this way as well provided you save as the type
All files (*.*).
As the message confirms, Windows does not allow empty file names. The
.htaccess file is used on Linux systems, and the dot (
.) in front of the name is used to make it a hidden file. However, Windows files consists of a name (before the dot) and a file type (after the dot), thus interpretting the "name" of the file as empty, and the file type as
So how can this limitation be overcome on a Windows system? Windows has no problems copying and editing a file named
.htaccess if it already exists, it's just renaming the file that causes problems.
It's possible to rename the file using the command prompt (previously DOS, for those who remember pre-windows times).
C:\xampp\htdocs\myjoomla>_, indicating the current folder location.
rename htaccess.txt .htaccessin order to rename the file (no confirmation is given, but the file is renamed)
Another alternative is to copy an existing
.htaccess from another Joomla installation (or download from an online Joomla installation). As mentioned earlier, the nameless file can be copied and edited without any problems by Windows.