What does .htaccess file do?

Discussion in 'Web Programming' started by migordito, Apr 11, 2018.

  1. migordito

    migordito New Member

    It is a configuration file for web servers running on Apache and is a must for web projects. From security regulations to user friendly URL addresses, many operations can be done with .htaccess files.

    They will be done with .htacces.
    1. Create user or SEO friendly URL addresses.
    2. Block or hide files or folders by encrypting them.
    3. Redirecting the wrong pages like 'Page Not Found', '404 Error' as you like.
    4. Do not want bots to block.
    5. Perform Hotlink blocking (prevent your images from appearing in another site)
    6. Do subdomain or directory execution.
    7. Blocking IP (You can also use this to redirect visitors to the 'during construction' page if you are in the process of building your site.)
    8. Compress data.
    9. Provide or forward iPhone detection.
    10. If the file does not have a special name, it looks like '.htaccess' in its syntax.

    Example Error Code Page Orientation According to the

    project's per
    RewriteEngine on
    're starting Katıp project, claims the following examples will be redirected to the page on which the error code 404.

    ErrorDo cument 404 https://www.site.com/sayfalar/404.php The
    gap is applied due to censorship.

    Another example.

    RewriteRule ^ index (. *). Html $ ./index.php [NC, L]

    So if there is a link that comes with index.html, show it the contents of index.php, but keep the link extension as .html.
     

Share This Page