try another color scheme:


Go Back   TECH6.0 > Get Techie > Programming > PHP/MySQL


What are .htaccess files?

This is a discussion on What are .htaccess files? within the PHP/MySQL section, part of the Programming category; Hi all What are .htaccess files in PHP?What is the use of it? can I made it myself or download ...

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 04-03-2009, 04:55 PM
No Avatar

Techie
 
Join Date: Mar 2009
Posts: 39
jeetu is on a distinguished road
Default What are .htaccess files?

Hi all

What are .htaccess files in PHP?What is the use of it?
can I made it myself or download it from anywhere?

Thanks
Reply With Quote
  #2  
Old 26-03-2009, 07:57 PM
Spec_tray's Avatar

Moderator
 
Join Date: Feb 2008
Posts: 147
Spec_tray will become famous soon enoughSpec_tray will become famous soon enough
Default

hai jeetu welcome to tech 555

.htaccess (hypertext access) or ( "distributed configuration files") is the default name of directory-level configuration files that allow for decentralized management of configuration when placed inside the web tree.

I think link below will be usefull to you to know more ..

http://httpd.apache.org/docs/1.3/howto/htaccess.html



Regards

Spec_tray
__________________
" There are no failures - just experiences and your reactions to them.

New members Please read before u post
General Tech6 Rules !!!

CSS Validator | Markup Validator | RSS Validator
Reply With Quote
  #3  
Old 26-03-2009, 11:20 PM
webwizzy's Avatar

Administrator
 
Name: Vinayak
Join Date: Feb 2008
Location: India
Phone: Samsung Wave
Posts: 1,116
webwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nice
Send a message via Yahoo to webwizzy
Default

can I made it myself or download it from anywhere?
As Said by jeetu
You make it yourself. In simple words, you define own rules for your website via .htaccess.

You can view/edit it through any FTP client, I recommend WinSCP.
.htaccess is hidden (this is what the . symbol indicates) so you'll have to enable viewing of hidden files.

For example, at this site we are using .htaccess for redirecting all visitors from www to non-www version of the site. We are also using it to password protect important directories (my favorite feature). All URL rewrites are done via .htaccess

Also note that htaccess is a directory-level config file for most webservers that includes Apache, litespeed etc. AFAIK there's no such term as htaccess for nginx webserver (which is gaining popularity rapidly), you instead put all rules directly in nginx.conf file and it has its own syntax.
__________________
Always TAG and SHARE your threads
Submit your site to TECH6 Directory
TECH6 on Facebook - Like Us

Would you like to Link To Us | Support TECH6 by going Premium
Know more about me at Vinayaks.com | Follow TECH6 at Twitter


Reply With Quote
  #4  
Old 25-09-2009, 09:02 PM
No Avatar

Learner
 
Join Date: Sep 2009
Location: Sweden
Posts: 10
SikoSoft is on a distinguished road
Send a message via Skype™ to SikoSoft
Default

I think it's important to also note that two things not mentioned here:

*IF* you have a dedicated server, or root access to your server, then it's always preferable to put your rules and instructions in the server's httpd.conf file (for performance reasons; in fact, there are some references to this in Apache's documentation)

Also, the files do NOT have to be called .htaccess (this is just the conventional name). I don't use .htaccess for the simple reason that everyone expects to find your web configuration here. And one of the first rules of security is that the less they know, the less they can do. Again, you probably need root access for this (such as on a dedicated server), but I'd suggest using a different naming method (you update this in Apache's config files). This enables to draw much less attention to these files, since they can contain sensitive information.
__________________
[ creating worlds ]
http://www.sikosoft.com
Reply With Quote
  #5  
Old 25-09-2009, 10:45 PM
webwizzy's Avatar

Administrator
 
Name: Vinayak
Join Date: Feb 2008
Location: India
Phone: Samsung Wave
Posts: 1,116
webwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nicewebwizzy is just really nice
Send a message via Yahoo to webwizzy
Default

Also, the files do NOT have to be called .htaccess (this is just the conventional name). I don't use .htaccess for the simple reason that everyone expects to find your web configuration here. And one of the first rules of security is that the less they know, the less they can do. Again, you probably need root access for this (such as on a dedicated server), but I'd suggest using a different naming method (you update this in Apache's config files). This enables to draw much less attention to these files, since they can contain sensitive information.
As Said by SikoSoft View Post
This is an excellent point SikoSoft.
__________________
Always TAG and SHARE your threads
Submit your site to TECH6 Directory
TECH6 on Facebook - Like Us

Would you like to Link To Us | Support TECH6 by going Premium
Know more about me at Vinayaks.com | Follow TECH6 at Twitter


Reply With Quote
  #6  
Old 30-09-2009, 09:44 AM
No Avatar

Learner
 
Name: Jason
Join Date: Sep 2009
Location: United States
Phone: Not in the list
Posts: 4
SuperFastBuys.com is on a distinguished road
Default

I think it's important to also note that two things not mentioned here:

Also, the files do NOT have to be called .htaccess (this is just the conventional name). I don't use .htaccess for the simple reason that everyone expects to find your web configuration here. And one of the first rules of security is that the less they know, the less they can do. Again, you probably need root access for this (such as on a dedicated server), but I'd suggest using a different naming method (you update this in Apache's config files). This enables to draw much less attention to these files, since they can contain sensitive information.
As Said by SikoSoft View Post
You can also do prevent viewing of the .htaccess file by adding this inside:
HTML Code:
<Files .htaccess>
order allow,deny
deny from all
</Files> 
Reply With Quote
  #7  
Old 03-11-2011, 07:00 PM
No Avatar

Learner
 
Join Date: Oct 2011
Posts: 24
newsky is on a distinguished road
Default

A .htaccess (hypertext access) file is a directory-level configuration file supported by several web servers, that allows for decentralized management of web server configuration.
The original purpose of .htaccess - reflected in its name - was to allow per-directory access control, by for example requiring a password to access the content. Nowadays however, the .htaccess files can override many other configuration settings including content type and character set, CGI handlers, etc.
These files are placed inside the web tree, and are able to override a subset of the server's global configuration for that directory, and all sub-directories.
__________________
quang cao nha dat
Reply With Quote
Reply

Bookmarks


Thread Tools
Display Modes




All times are GMT +5.5. The time now is 08:16 AM.

Contact Us - Tech6.com - Link to Us - Advertise - Submit Site - Privacy Statement - TOS - Top