Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»General Articles»What is .htaccess File and Basic Uses

    What is .htaccess File and Basic Uses

    By RahulFebruary 23, 20152 Mins Read

    What is .htaccess ?

    .htaccess (hypertext access) is a useful file for Many of web server to apply settings per directory basis. It allows to override default configuration of Apache server on run time. Using .htaccess we can easily enable or disable any functionality at the run time.

    Advertisement

    .htaccess is a complete file name, It’s not just the extension of file.

    Be careful while working with .htaccess configuration. Any small mistake may stop your entire site. Most probably we get 500 error with any syntax error in .htaccess file.

    Uses of .htaccess ?

    We can use .htaccess to accomplish various tasks at the run time. Below is a list of some most frequently uses of .htaccess.

    1. Redirect or Rewrite URLs

    Using .htaccess we can easily redirect user from one url to other url easily. Also we can direct urls to other url without changing url in browser windows.

    2. Enable Password Protection

    Using .htaccess we can enable basic http authentication on entire site or on a specific directory access. It prevent unauthorized access of data.

  • Visit: How to Setup Basic Authentication in Apache with .htaccess
  • 3. Define Custom Error Pages

    When our website faces any error in backend, web server shows its pre defined error pages for each errors. We can redesign own error pages and show to end users in case of error occurred on site.

    4. Allow or Deny Users

    We can simply restrict any users to access entire site of specific pages of website based on there ip address. We can simple allow our secure pages to access from specific ips only. In that case if any user tried to access secure page from unauthorized pages will get error page.

    5. Change URLs

    .htaccess is widely used for changing website urls to make to simple and seo friendly. We can easily convert urls showing in web browser user-friendly.

    htaccess
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Error: EACCES: permission denied, scandir (Resolved)

    How To Install Python 3.11 on Ubuntu 22.04 / 20.04

    Excluding URLs from ProxyPass in Apache

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Error: EACCES: permission denied, scandir (Resolved)
    • How To Install Python 3.11 on Ubuntu 22.04 / 20.04
    • How to Install Python 3.11 on Amazon Linux 2
    • An Introduction to the “./configure” Command: Compiling Source Code in Linux
    • How to Install PHP 8.x on Pop!_OS
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.