The Joomla! Forum ™



Forum rules


Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Security Checklist
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.



Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Fri Jun 13, 2008 2:01 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Feb 26, 2008 1:10 pm
Posts: 31
Ok, I've been reading all over the place and can't find an answer to this question.

What is the difference between the htaccess.txt file which comes as standard with J! and the .htaccess file which you are supposed to rename it to under certain circumstances.

Should I always rename it to .htaccess? When should I keep it called htaccess.txt?

As I say I've read the security links I've seen around here and they mention .htaccess all the time, but there's nothing specific as to what situations to use either file

Thanks


Top
 Profile  
 
PostPosted: Fri Jun 13, 2008 2:05 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Fri Aug 12, 2005 12:38 am
Posts: 13388
Location: Sydney - Australia
Rename htaccess.txt to .htaccess
This is the designed behavior.

BTW try using the Google search above.. I entered 'htaccess.txt' then I click on the documentation refinement tag and look what you have:

http://docs.joomla.org/Administration_FAQs
http://docs.joomla.org/Security_and_Performance_FAQs
http://docs.joomla.org/Screen.config.15

All the best.

_________________
Brad Baker - Follow me on Google+
http://www.rochen.com - Joomla! Hosting, the correct way.
http://www.joomlatutorials.com <-- Joomla Help & Tutorials
^Now with Joomla 2.5 and Joomla 3.0 Tutorials


Top
 Profile  
 
PostPosted: Fri Jun 13, 2008 6:02 pm 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Fri Mar 21, 2008 9:26 pm
Posts: 147
Location: Bad Schwartau / Lubeck, Germany
One explanation in addition to Brad's documentation:
The file is only in effect if it has the name .htaccess (some special name that has nothing to do with J! at all). The htaccess.txt is something like a master copy to this file that may be changed or completed by experienced users before renaming it.

Sometimes, there already is a .htaccess file in effect in your root folder prior to installation. (Actually, that is probably the reason for Joomla's file not having the name .htaccess in the first place. Otherwise the old file would be overwritten.) If that is the case, it might contain some provider-specific lines that have to be added to Joomla's file before it replaces the old one.

Bye,
Martin


Top
 Profile  
 
PostPosted: Fri Jun 13, 2008 8:35 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Feb 26, 2008 1:10 pm
Posts: 31
Thanks both for the replies. Both are helpful. The documentation is very overwhelming as much of it refers to versions pre 1.5, so I don't know how much of it is still relevant.

I have renamed the file accordingly, so that's a start :)


Top
 Profile  
 
PostPosted: Thu Aug 20, 2009 5:29 am 
User avatar
Joomla! Fledgling
Joomla! Fledgling

Joined: Thu Aug 20, 2009 5:27 am
Posts: 1
Location: Virginia
So helpful, thanks guys! I finally have SEF urls.
http://docs.joomla.org/SEF_URLs_in_Joomla!_1.5

_________________
I am trying to teach myself Joomla, welcome any advice
currently using yootheme WayBeyond


Top
 Profile  
 
PostPosted: Mon Feb 15, 2010 12:57 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Mon Feb 15, 2010 12:00 pm
Posts: 1
One of the main reasons for there being an htaccess.txt file in most cases is because the Windows operating system will not allow you to create an ,htaccess file. There has to be a file name in front of an extension, according to Windows error message dialogs.

There are ways to get around that. In Notepad, I think you just place the name in quotes, as in ".htaccess" or better yet use any number of third-party NotePad replacements. MetaPad is a good one. Then just name the file ,htaccess.

.htaccess is a hidden system file in Unix, Linux and Apple OSX. I just read somewhere that in Apple you cannot even access a system file, and therefore you must keep an editable copy called htaccess.txt, make changes and save the htaccess.txt, then save again as .htaccess.

In Linux and Unix, filenames that begin with a dot are hidden files, usually also system files. But you can show hidden files and folders, and edit them. Naturally, the user is cautioned to have a good reason to edit a system file, and know a little something about what it does before slogging away. Next thing might be a computer that will not run anymore!

The Apache server uses .htaccess if the httpd.conf is configured to allow it, and that configuration is under the control of the web host, unless you have your own dedicated server.. Some Web hosts do not permit use of ,htaccess, which overrides configuration settings in the server httpd.conf.

While .htaccess is neither a hidden file nor a system file in Windows, an Apache server still uses it as a server configuration file.

A Windows IIS server does not use .htaccess. It has its own ways of doing things.

Never upload a copy of your Apache server's ,htaccess file with the htaccess.txt file name. That makes your server configuration settings a matter of public record, just like any other text document posted to the site. If you must upload your .htaccess file as htaccess.txt, immediately rename the server copy to .htaccess.

I know I'm a little late coming in on this thread, but because it still is high in the search results, it still provides useful information to people searching for things.


Top
 Profile  
 
PostPosted: Mon Feb 15, 2010 6:45 pm 
User avatar
Joomla! Hero
Joomla! Hero

Joined: Sat Oct 21, 2006 10:20 pm
Posts: 2726
Location: Wisconsin USA
The reason that Joomla names the file htaccess.txt is so that it does not overwrite any existing .htaccess files that may be present in the desired install directory. As Brad said, this is designed behavior. It is up to the person in control of the site to determine if something needs to be added to the Joomla htaccess file (such as an existing 301 redirect to a subdirectory) before it is enabled.

_________________
PhilD -- Unrequested PM's and/or emails may not get a response.
Security Moderator


Top
 Profile  
 
PostPosted: Mon Feb 15, 2010 10:59 pm 
User avatar
Joomla! Master
Joomla! Master

Joined: Mon Mar 20, 2006 1:56 am
Posts: 12411
Location: The Girly Side of Joomla in Sussex
I am going to try and correct/explain some popular misconceptions/beliefs over this very powerful .htaccess file with no offence to larry71 who just covered the subject

Larry71 wrote:
Windows operating system will not allow you to create an ,htaccess file.

i have not known a windows server to use a .htaccess file nativley.

Quote:
There are ways to get around that. In Notepad, I think you just place the name in quotes, as in ".htaccess"
wil sometimes work on older IIS systems

Quote:
.htaccess is a hidden system file in Unix, Linux and Apple OSX. I just read somewhere that in Apple you cannot even access a system file, and therefore you must keep an editable copy called htaccess.txt, make changes and save the htaccess.txt, then save again as .htaccess.
you could just zauthfile it to save time but i am not a MAC user.

In Linux and Unix, filenames that begin with a dot are hidden files, usually also system files. But you can show hidden files and folders, and edit them. Naturally, the user is cautioned to have a good reason to edit a system file, and know a little something about what it does before slogging away. Next thing might be a computer that will not run anymore!

Quote:
The Apache server uses <snip>
thats a miss-match of several different copy and paste items. you can also count vps in that paragraph

Quote:
an Apache server still uses it as a server configuration file.
if its named correctly.

Quote:
A Windows IIS server does not use .htaccess.
as you have already said.

Quote:
Never upload a copy of your Apache server's ,htaccess file with the htaccess.txt file name. That makes your server configuration settings a matter of public record, just like any other text document posted to the site. If you must upload your .htaccess file as htaccess.txt, immediately rename the server copy to .htaccess.
can we clarify that where you have put ,htaccess you actually mean .htaccess. it is always recommended to rename the htaccess.txt to .htaccess on site setup. the reasons it has the .txt extension has already been explained, along with the fact cpanel forces a .htaccess creation on account creation. in addition if you want to know what a joomla site has as an htaccess.txt, just download it from joomla. I wuld assume that any changes you make to your .htaccess would be done directly and not by uploading and then renaming the file.
I hope the OP question has now been answered/explained and some people have learned things.

anyone curious on joomla and IIS then see viewforum.php?f=543

_________________
HU2HY- Poor questions = Poor answer
Un requested Help PM's will be added to the foe list and possibly just deleted
{Community.Connect Administrator }{ Showcase & Security Moderator}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 



Who is online

Users browsing this forum: No registered users and 25 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group