directive does not work in .htaccess
Posted by: LivingThis (---.cable.dynamic.v4.ziggo.nl)
Date: February 25, 2020 03:00PM

Hello I would like to ask a question about getting a directive working in htaccess under wamp apache.

this is my wamp set up

1) Os
Windows 10 HOME 64 bit version 1903
build 18362 (Windows 10) AMD64
2 - Version WampServer :: 3.1.9 64 bit
3 - Apache Version :: 2.4.39
4 - PHP Version :: 7.3.5
5 - MySQL Version :: 5.7.26
5a - MariaDB version :: 10.3.14


WampServer icon is green:

8 - Do you have access to localhost (Homepage WampServer)?
yes
8a - If so, is there an error message at the bottom of the page?
no

9 - Do you have access to phpMyAdmin?
yes

10 - If you refer to an error message, please include the EXACT wording of the error in your post

in the apache error log I found
[core:alert] [pid 10960:tid 1236] [client ::1:50614]/..../.htaccess: AllowOverride not allowed here, referer: ....

11 - If you use an Antivirus and / or Firewall, please include the names of these
WINDOWS DEFENDER
12 - What is the full path to the installation of WampServer
D:\wamp64\wampmanager.exe

13 - If you have one or more Virtual Hosts defined, please show their definition(s)
<VirtualHost *:80>
ServerName mywebsite.localhost
ServerAlias *.mywebsite.localhost
DocumentRoot "D:/wamp64/www/mywebsite"
<Directory "D:/wamp64/www/mywebsite/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>


I want to get rid of extensions in the url address bar, so I made a .htaccess file and placed it in a new subdirectory with a new virtual domain pointing at it.

I checked php_info() , rewrite engine is on and so is mod_mime ( at least it is loaded in the modules list )

Some directives work in the htaccess file but if I want to use directives to change the extension .php I get no result.

this is the directive I used:


RewriteEngine On
RewriteRule ^([^\.]+)$ $1.php [NC,L]


then I added AllowOverride All above it.
This makes the page crash
in the apache error log I found
[core:alert] [pid 10960:tid 1236] [client ::1:50614]/..../.htaccess: AllowOverride not allowed here, referer: ....


I have been searching for more than a day now. The WAMP server might be casted in a specific way to get it working.

Can someone tell if any other conf files have to be adjusted and in what way should this be done?

Options: ReplyQuote
Re: directive does not work in .htaccess
Posted by: RiggsFolly (Moderator)
Date: February 25, 2020 05:33PM

See [stackoverflow.com]


The error `htaccess: AllowOverride not allowed here, referer: ....` is of your own making, you cannot put that directive in a `.htaccess` file, like the error says

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 1 time(s). Last edit at 02/26/2020 10:30AM by RiggsFolly.

Options: ReplyQuote
Re: directive does not work in .htaccess
Posted by: LivingThis (---.cable.dynamic.v4.ziggo.nl)
Date: February 26, 2020 09:17AM

Yest this worked very well thank you very much

Options: ReplyQuote


Sorry, only registered users may post in this forum.