All I wanted to do today was write a redirection rule for the subfolder, for example: You enter the URL: example.com and you are redirected to example.com/subfolder
Such a simple desire. I tried to find a solution on the Internet. The internet told me to add the .htaccess file to the htdocs root directory with:
RewriteEngine on RewriteCond %{HTTP_HOST} ^example\.com$ RewriteRule (.*) http://www.example.com/$1 [R=301,L] RewriteRule ^$ subfolder [L]
I have done it. But no success obviously, they did not tell me that I had to uncomment the module in httpd.conf :
LoadModule rewrite_module modules/mod_rewrite.so
So, I did it too. No success. They did not tell me that I need to modify my httpd.conf so that the .htaccess file is included:
<Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Deny from all </Directory> DocumentRoot "c:/Apache24/htdocs" <Directory "c:/Apache24/htdocs"> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>
Again, no success, because I get this error when entering the URL:
Forbidden You do not have permission to access this server.
Now I am stuck and I could not find more solutions on the Internet. I just run Apache 2.4 on my Windows 7 machine for private reasons.
QuantumHive Feb 04 '14 at 11:56
source share