[opensuse] apache Server Error 500 for .htaccess on localhost
Hello, I am doing something wrong with my apache settings to make work .htaccess in a directory... I hope you can help me :-) I need to have all calls to .html-pages in some subdirectories redirected to my index.php putting the path in a parameter called "wo". My htaccess looks like this: ------------ RewriteEngine on rewriteRule ^(en/)(.*)(\.html?)$ index\.php?%{QUERY_STRING}&wo=$1$2 [L] RewriteRule ^(de/)(.*)(\.html?)$ index\.php?%{QUERY_STRING}&wo=$1$2 [L] RewriteRule ^(es/)(.*)(\.html?)$ index\.php?%{QUERY_STRING}&wo=$1$2 [L] RewriteRule ^(cc/)(.*)(\.html?)$ index\.php?%{QUERY_STRING}&wo=$1$2 [L] RewriteRule ^(index*)(.*)(\.*?)$ index\.php ------------- (This works on my online server in a hosting company) To make .htaccess work I added a file "vhost_db2020.conf" to /etc/apache2/vhosts.d/ with the following content: ------------- <VirtualHost *:80> <Directory /srv/www/htdocs/Entwicklung/danielbauer2020> Options Indexes FollowSymLinks MultiViews AllowOverride All </Directory> </VirtualHost> ------------- Now when I put the .htaccess file in /srv/www/htdocs/Entwicklung/danielbauer2020/ I get an Error 500 (the page works without .htaccess, but, of course, without the desired redirects) In the apache-log I only find the following: ------------- ::1 - - [25/May/2020:11:51:09 +0200] "GET /Entwicklung/danielbauer2020/index.html HTTP/1.1" 500 1004 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0" ::1 - - [25/May/2020:11:51:33 +0200] "GET /Entwicklung/danielbauer2020/ HTTP/1.1" 500 1004 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0" ------------- I believe the rewrite module is loaded: ------------- sudo a2enmod -l actions alias auth_basic authn_core authn_file authz_host authz_groupfile authz_core authz_user autoindex cgi dir env expires include log_config mime negotiation setenvif ssl socache_shmcb userdir reqtimeout version php7 rewrite ------------- I remember years ago that I had to put "something" in the etc/apache2 directory to make it work, but I don't remember what :-( Can you see where is my error? Thanks Daniel -- Daniel Bauer photographer Basel Málaga https://www.patreon.com/danielbauer https://www.daniel-bauer.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Daniel Bauer wrote:
In the apache-log I only find the following:
What about the error log? -- Per Jessen, Zürich (20.4°C) http://www.hostsuisse.com/ - virtual servers, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Per Jessen wrote:
Daniel Bauer wrote:
In the apache-log I only find the following:
What about the error log?
Actually, try enabling rewriting in your vhosts definition - IIRC, it has to be enabled there. <VirtualHost *:80> RewriteEngine on <Directory /srv/www/htdocs/Entwicklung/danielbauer2020> Options Indexes FollowSymLinks MultiViews AllowOverride All </Directory> </VirtualHost> -- Per Jessen, Zürich (20.2°C) http://www.hostsuisse.com/ - dedicated server rental in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Am 25.05.20 um 13:16 schrieb Per Jessen:
Per Jessen wrote:
Daniel Bauer wrote:
In the apache-log I only find the following:
What about the error log?
Haha stupid me, thought the apache log was it
Actually, try enabling rewriting in your vhosts definition - IIRC, it has to be enabled there.
<VirtualHost *:80> RewriteEngine on
<Directory /srv/www/htdocs/Entwicklung/danielbauer2020> Options Indexes FollowSymLinks MultiViews AllowOverride All </Directory> </VirtualHost>
Looks like that did the trick. It's working now, thanks Per! -- Daniel Bauer photographer Basel Málaga https://www.patreon.com/danielbauer https://www.daniel-bauer.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (2)
-
Daniel Bauer
-
Per Jessen