Hi all. As the title says, .htaccess doesn't work even after I set the allowOverride All option in the vhost. Here is the exact section of the vhost. <Directory "/var/www/mydomain.tld/public-html"> AllowOverride All </Directory> What am I doing wrong?
What are the contents of the .htaccess file? Does your Apache error log give any clues? What happens if you put incorrect syntax in the .htaccess file, does it throw an error when loading your site?
1. The contents of the .htaccess file are the following. ErrorDocument 404 /var/www/my_website.com/public-html/404.php. 2. The apache error log gives no clues. Plus, when I type in, apache2ctl configtest, it says syntax ok. 3. Nothing happens. No errors when loading my site.
So, you want to have a custom 404 page. You can change your current .htaccess content with this one, make sure the .htaccess and 404.php file are in the same directory, if not you can modify the 404.php file path: ErrorDocument 404 /404.php To test it, you need to go to a non-existent page, for example: yourdomain.com/a3813413dahbsdkasjd You should be able to see the custom 404 page.
Well, it means you need to modify the 404.php path in your .htaccess file, the /404.php means it's in the webroot.
I read through that. The problem is, Apache doesn't seem to read the htaccess file even if I put the AllowOverride All parameter in the vhost. Even though I put gibberish in the file, my site doesn't give a 500 error. So the permalink option doesn't work properly.
Can you confirm your Apache configuration has the following line in it: # AccessFileName: The name of the file to look for in each directory # for additional configuration directives. See also the AllowOverride # directive. # AccessFileName .htaccess Code (markup): Chris
Hi Chris. Yes, I can confirm that those lines are in my apache.conf file located at /etc/apache2/apache2.conf..
You are going to have to go through all configuration files to see if there is a conflicting statement. Best way to do this is to enable mod_info, then only allow your IP to view it. These are the steps I took below on my test server (Ubuntu): sudo a2enmod info sudo service apache2 restart apachectl -M (make sure info_module is loaded) vim /etc/apache2/mods-enabled/info.conf Edit the file to add your computers IP. Example Require ip 1.1.1.1 sudo service apache2 restart You should now be able to visit the following address (use your servers IP) and have all of the configuration listed: http://your.servers.ip.here/server-info Code (markup): Chris
This may be a conflict. In file: /etc/apache2/apache2.conf <Directory /> Options FollowSymLinks AllowOverride None Require all denied : </Directory> Code (markup): Am I correct?
No, that should not have any effect as you are calling out the other directory. To test though, comment out those lines, restart and check. Chris
Hi. Could this be the issue? In file: /etc/apache2/apache2.conf <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted : </Directory> Code (markup):