.htaccess files are ignored and do not work


2016-11-16 13:14:33 UTC


2017-07-17 16:25:55 UTC


Was this article helpful?

Have more questions?

Submit a request

.htaccess files are ignored and do not work

Applicable to:

  • Plesk for Linux


The rules defined in .htaccess files are ignored.


.htaccess files support is not enabled.


To enable .htaccess files support, create *.conf file in /etc/httpd/conf.d/ with the following content:

AccessFileName .htaccess

<Directory "/var/www/vhosts">
Options +All
AllowOverride All
Order allow,deny
Allow from all

Note: The configuration above is applicable for Apache 2.2. For Apache 2.4 Options +All should be replaced with Options All

Then, restart Apache:

# service httpd restart

Please note that in Debian and Ubuntu the service is named "apache2" instead of "httpd" and the path is /etc/apache2/conf.d/ , instead of /etc/httpd/conf.d/ .

Have more questions? Submit a request


  • 0
    Gerasimos Perentidis

    The fix does not work.

    Also the article is vague.

    **** create *.conf file in /etc/httpd/conf.d/ ****

    What is   "  *.conf  "   ???

    What is the correct name for the file ?

  • 0
    Vitaly Zhidkov

    @Gerasimos, you can give any name to this file. For example "enablehtaccess.conf"

  • 0

    I am getting this error when I want to save the file

    [ Error writing /etc/httpd/conf.d/zz010_psa_httpd.conf: No such file or direct ]

  • 0
    Bulat Tsydenov

    @Cihan, you should not touch this file, it is generated by Plesk automatically. In order to regenerate it, you can run `plesk sbin httpdmng --reconfigure-server`

  • 0

    @Bulat I didn't touch it, it doesn't exist. I read in this document (in German) to do it like that: https://kb.plesk.com/de/124

    Also it doesn't matter how I name the file, always getting the error No such file or direct

  • 0
    Bulat Tsydenov

    @Cihan, it seems you don't have `/etc/httpd/conf.d/` folder. Maybe you are using Ubuntu/Debian? In this case, the path should be /etc/apache2/conf.d/

  • 0
    Alexandros Boukouris

    Not working in Plesk Onyx.


    Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

    ● httpd.service - The Apache HTTP Server
    Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
    Active: failed (Result: exit-code) since Tue 2017-05-02 17:26:50 EEST; 23s ago
    Docs: man:httpd(8)
    Process: 22295 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
    Process: 22293 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
    Main PID: 22293 (code=exited, status=1/FAILURE)

    May 02 17:26:50 systemd[1]: Starting The Apache HTTP Server...
    May 02 17:26:50 httpd[22293]: AH00526: Syntax error on line 4 of /etc/httpd/conf.d/enablehtaccess.conf:
    May 02 17:26:50 httpd[22293]: You may not use 'Options +All' or 'Options -All'.
    May 02 17:26:50 systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
    May 02 17:26:50 kill[22295]: kill: cannot find process ""
    May 02 17:26:50 systemd[1]: httpd.service: control process exited, code=exited status=1
    May 02 17:26:50 systemd[1]: Failed to start The Apache HTTP Server.
    May 02 17:26:50 systemd[1]: Unit httpd.service entered failed state.
    May 02 17:26:50 systemd[1]: httpd.service failed.


    Obviously the "Options +All" is not accepted by httpd. Is it newer version and needs something else?


    Edited by Alexandros Boukouris
  • 0
    Nikolay Zhmuk

    2Alexandros, It depends on version of Apache. For Apache 2.4 "Options All" should be used. The article has been updated. Thank you for the input.

Please sign in to leave a comment.