htaccess Deny from all and 500 Internal Server Error - .htaccess

I want to restrict direct access to a specific directory (and all the files inside) on my local server.
The directory is: C:/Server/www/project/html/
I've tried the following code (.htaccess is placed in www directory - /project/html/ doesn't work too):
<Directory "C:/Server/www/project/html/">
AllowOverride all
Order Deny,Allow
Deny from all
</Directory>
However, it causes 500 Internal Server Error and I can't understand why.
Apache error log:
[Fri Aug 05 16:06:01 2011] [alert] [client 127.0.0.1] C:/Server/www/.htaccess: <Directory not allowed here, referer: http://localhost/project/index.php?id=8
[Fri Aug 05 16:06:01 2011] [alert] [client 127.0.0.1] C:/Server/www/.htaccess: <Directory not allowed here, referer: http://localhost/project/index.php?id=8
[Fri Aug 05 16:06:01 2011] [alert] [client 127.0.0.1] C:/Server/www/.htaccess: <Directory not allowed here, referer: http://localhost/project/index.php?id=8
[Fri Aug 05 16:06:01 2011] [alert] [client 127.0.0.1] C:/Server/www/.htaccess: <Directory not allowed here, referer: http://localhost/project/index.php?id=8
[Fri Aug 05 16:06:01 2011] [alert] [client 127.0.0.1] C:/Server/www/.htaccess: <Directory not allowed here, referer: http://localhost/project/index.php?id=8
[Fri Aug 05 16:06:02 2011] [alert] [client 127.0.0.1] C:/Server/www/.htaccess: <Directory not allowed here, referer: http://localhost/project/index.php?id=8
[Fri Aug 05 16:54:12 2011] [alert] [client 127.0.0.1] C:/Server/www/.htaccess: <Directory not allowed here, referer: http://localhost/project/index.php?id=8
[Fri Aug 05 16:54:12 2011] [alert] [client 127.0.0.1] C:/Server/www/.htaccess: <Directory not allowed here
[Fri Aug 05 17:05:06 2011] [alert] [client 127.0.0.1] C:/Server/www/.htaccess: <Directory not allowed here, referer: http://localhost/project/index.php?id=8

Check Apache error log for exact error description.
In any case -- the reason for this error is simple: <Directory> directive CANNOT be placed in .htaccess file -- only server config or virtual host.
http://httpd.apache.org/docs/current/mod/core.html#directory

for me it required enable headers module to apache

Related

Problem with ERR_BAD_SSL_CLIENT_AUTH_CERT on httpd server

I have an application running on httpd server under Centos 8. The Apache server requires user to show vaild certificate and than the ssl variables like DN, CN and SERIAL are passed to the Flask application (than the access verification is run).
The app when not vaild cert is given e.g. user's cert is not in database, should show error page under url "/site/public/failed" with proper info.
Problem is that only my cert is passed by Apache and than page loads correctly (My cert is in db), but when my collages (same company, same CA) try to reach it they are flashed with ERR_BAD_SSL_CLIENT_AUTH_CERT and blank page. I assume that even if they will be in db, the Apache wouldn't let them to access app on it.
When I check the logs after them try to connect, it looks different than when I am connecting. One thing that I have spotted is their cert is checked only with depth 0 when my goes to depth 2.
config:
Listen ip:443
##SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog
SSLSessionCache shmcb:/run/httpd/sslcache(512000)
SSLSessionCacheTimeout 300
SSLRandomSeed startup file:/dev/urandom 256
SSLRandomSeed connect builtin
SSLCryptoDevice builtin
##SSLCipherSuite PROFILE=SYSTEM
##SSLCipherSuite ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256
##SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1 -TLSv1.3
SSLHonorCipherOrder on
SSLCompression off
WSGIPythonHome /home/path/to/venv
WSGIRestrictStdin Off
WSGIRestrictStdout Off
<VirtualHost ip:443>
ServerName app.com
ErrorLog /etc/httpd/logs/sshproxy-secure.error_log
CustomLog /etc/httpd/logs/sshproxy-secure.access_log ssl_combined
SSLEngine on
SSLCertificateFile /home/path/to/crt.crt
SSLCertificateKeyFile /home/path/to/some_key.key
SSLCACertificateFile /etc/pki/tls/main_ca.crt
SSLCACertificateFile /path/to/more/ca.crt
WSGIDaemonProcess sshproxy threads=20 processes=2 python-path=/home/path/to/venv/lib/python3.10/site-packages
#user=user1 group=group1 threads=5
#WSGIPythonPath /opt/sshproxy/lib/python2.7/site-packages
WSGIScriptAlias / /home/path/to/wsgi-script/sshproxy-webserver-wsgi.py
WSGIScriptReloading On
<Directory /home/path/to/app>
WSGIProcessGroup sshproxy
WSGIApplicationGroup %{GLOBAL}
Require all granted
</Directory>
#<Location />
# SSLRequireSSL
#Require ip 126.16.13.20 126.16.18.
#</Location>
SSLVerifyClient optional
SSLVerifyDepth 5
SSLOptions +StdEnvVars
</VirtualHost>
Error logs when I connect (I deleted some sensitive data, but I believe its not important part of logs):
[Mon Aug 29 08:36:54.406586 2022] [ssl:debug] [pid 17586:tid 140176105887488] ssl_engine_kernel.c(2330): [client 126.189.244.168:60496] AH02043: SSL virtual host for servername app.com found
[Mon Aug 29 08:36:54.406615 2022] [ssl:debug] [pid 17586:tid 140176105887488] ssl_engine_kernel.c(2330): [client 126.189.244.168:60496] AH02043: SSL virtual host for servername app.com found
[Mon Aug 29 08:36:54.406629 2022] [core:debug] [pid 17586:tid 140176105887488] protocol.c(2314): [client 126.189.244.168:60496] AH03155: select protocol from , choices=h2,http/1.1 for server app.com
[Mon Aug 29 08:36:59.631867 2022] [ssl:debug] [pid 17586:tid 140176105887488] ssl_engine_kernel.c(1751): [client 126.189.244.168:60496] AH02275: Certificate Verification, depth 2, CRL checking mode: none (0) [subject:
[Mon Aug 29 08:36:59.632161 2022] [ssl:debug] [pid 17586:tid 140176105887488] ssl_engine_kernel.c(1751): [client 126.189.244.168:60496] AH02275: Certificate Verification, depth 1, CRL checking mode: none (0) [subject:
[Mon Aug 29 08:36:59.632380 2022] [ssl:debug] [pid 17586:tid 140176105887488] ssl_engine_kernel.c(1751): [client 126.189.244.168:60496] AH02275: Certificate Verification, depth 0, CRL checking mode: none (0) [subject:
[Mon Aug 29 08:36:59.632679 2022] [ssl:debug] [pid 17586:tid 140176105887488] ssl_engine_kernel.c(2246): [client 126.189.244.168:60496] AH02041: Protocol: TLSv1.3, Cipher: TLS_AES_128_GCM_SHA256 (128/128 bits)
[Mon Aug 29 08:36:59.633566 2022] [ssl:debug] [pid 17586:tid 140176105887488] ssl_engine_kernel.c(383): [client 126.189.244.168:60496] AH02034: Initial (No.1) HTTPS request received for child 204 (server domain:443)
[Mon Aug 29 08:36:59.633893 2022] [authz_core:debug] [pid 17586:tid 140176105887488] mod_authz_core.c(820): [client 126.189.244.168:60496] AH01626: authorization result of Require all granted: granted
[Mon Aug 29 08:36:59.633925 2022] [authz_core:debug] [pid 17586:tid 140176105887488] mod_authz_core.c(820): [client 126.189.244.168:60496] AH01626: authorization result of <RequireAny>: granted
Error logs when they connect:
[Tue Aug 30 11:01:41.293387 2022] [ssl:debug] [pid 24609:tid 140421665646336] ssl_engine_kernel.c(2330): [client 126.189.44.235:57122] AH02043: SSL virtual host for app.com
[Tue Aug 30 11:01:41.293496 2022] [ssl:debug] [pid 24609:tid 140421665646336] ssl_engine_kernel.c(2330): [client 126.189.44.235:57122] AH02043: SSL virtual host for app.com
[Tue Aug 30 11:01:41.293519 2022] [core:debug] [pid 24609:tid 140421665646336] protocol.c(2314): [client 126.189.44.235:57122] AH03155: select protocol from , choices=h2,http/1.1 for server
[Tue Aug 30 11:01:41.476727 2022] [ssl:debug] [pid 24609:tid 140421665646336] ssl_engine_kernel.c(1751): [client 126.189.44.235:57122] AH02275: Certificate Verification, depth 0, CRL checking m
[Tue Aug 30 11:01:41.476860 2022] [ssl:info] [pid 24609:tid 140421665646336] [client 126.189.44.235:57122] AH02276: Certificate Verification: Error (66): EE certificate key too weak [subject: e
[Tue Aug 30 11:01:41.476988 2022] [ssl:info] [pid 24609:tid 140421665646336] [client 126.189.44.235:57122] AH02008: SSL library error 1 in handshake (server domain:443)
[Tue Aug 30 11:01:41.477100 2022] [ssl:info] [pid 24609:tid 140421665646336] SSL Library Error: error:1417C086:SSL routines:tls_process_client_certificate:certificate verify failed
[Tue Aug 30 11:01:41.477120 2022] [ssl:info] [pid 24609:tid 140421665646336] [client 126.189.44.235:57122] AH01998: Connection closed to child 194 with abortive shutdown (server napupp19.corpne
[Tue Aug 30 11:01:44.545107 2022] [ssl:info] [pid 24609:tid 140421573326592] [client 126.189.44.235:57125] AH01964: Connection to child 205 established (server domain:443)
[Tue Aug 30 11:01:44.545572 2022] [socache_shmcb:debug] [pid 24609:tid 140421573326592] mod_socache_shmcb.c(532): AH00835: socache_shmcb_retrieve (0xea -> subcache 10)
[Tue Aug 30 11:01:44.545621 2022] [socache_shmcb:debug] [pid 24609:tid 140421573326592] mod_socache_shmcb.c(917): AH00851: shmcb_subcache_retrieve found no match
[Tue Aug 30 11:01:44.545634 2022] [socache_shmcb:debug] [pid 24609:tid 140421573326592] mod_socache_shmcb.c(542): AH00836: leaving socache_shmcb_retrieve successfully
I don't know what's the reason why their cert is checked starting at depth 0, while mine is from depth 2?
Changing cipher string = default#seclevel=2 to cipher string = default#seclevel=1 in openssl.cnf file has resolved problem. Nonetheless I don't know why my cert was passed while others didn't. We all have standardized token with cert, so they all should have similar sec level.

CWP https non-www redirect failed in both htaccess and apache

i tried to make my website working only within non-www https (ex, https://customsite.tld)
i want all request to my domain to be server from "https://customsite.com"
i have tried to many things but all of them doesnt work & websites insists to open using same www url "https://www.customsite.com"
things that i have tried are as follows :
- i make sure that apache "rewrite_module" is loaded
changing AllowOverride to Allow within apache configurations (main & vhost config)
redirect within Apache configuration
Redirect permanent / https://customsite.com/
i used to many code within htacces the following is my current htaccess (but it doesnt work too)
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\.customsite\.com [NC]
RewriteRule (.*) https://customsite.com/$1 [L,R=301]
i also enabled rewrite log & when trying to accsee site using www it gives me the following
[Mon Sep 30 11:59:52.772074 2019] [rewrite:trace2] [pid 5473:tid 140059438470912] mod_rewrite.c(483): [client 197.37.110.119:59413] 197.37.110.119 - - [www.customsite.com/sid#13141e8][rid#7f620c01fcd0/initial] init rewrite engine with requested uri /login
[Mon Sep 30 11:59:52.772105 2019] [rewrite:trace1] [pid 5473:tid 140059438470912] mod_rewrite.c(483): [client 197.37.110.119:59413] 197.37.110.119 - - [www.customsite.com/sid#13141e8][rid#7f620c01fcd0/initial] pass through /login
[Mon Sep 30 11:59:52.895060 2019] [rewrite:trace2] [pid 5473:tid 140059430078208] mod_rewrite.c(483): [client 197.37.110.119:59413] 197.37.110.119 - - [www.customsite.com/sid#13141e8][rid#7f620c01a100/initial] init rewrite engine with requested uri /css/main.css, referer: https://www.customsite.com/login
[Mon Sep 30 11:59:52.895081 2019] [rewrite:trace1] [pid 5473:tid 140059430078208] mod_rewrite.c(483): [client 197.37.110.119:59413] 197.37.110.119 - - [www.customsite.com/sid#13141e8][rid#7f620c01a100/initial] pass through /css/main.css, referer: https://www.customsite.com/login
[Mon Sep 30 11:59:53.084281 2019] [rewrite:trace2] [pid 5472:tid 140059472041728] mod_rewrite.c(483): [client 197.37.110.119:59415] 197.37.110.119 - - [www.customsite.com/sid#13141e8][rid#7f620c01f870/initial] init rewrite engine with requested uri /css/auth.css, referer: https://www.customsite.com/login
[Mon Sep 30 11:59:53.084336 2019] [rewrite:trace1] [pid 5472:tid 140059472041728] mod_rewrite.c(483): [client 197.37.110.119:59415] 197.37.110.119 - - [www.customsite.com/sid#13141e8][rid#7f620c01f870/initial] pass through /css/auth.css, referer: https://www.customsite.com/login
[Mon Sep 30 11:59:53.665350 2019] [rewrite:trace2] [pid 5472:tid 140059455256320] mod_rewrite.c(483): [client 197.37.110.119:59415] 197.37.110.119 - - [www.customsite.com/sid#13141e8][rid#7f620c01a100/initial] init rewrite engine with requested uri /images/e-learn2.png, referer: https://www.customsite.com/login
[Mon Sep 30 11:59:53.665373 2019] [rewrite:trace1] [pid 5472:tid 140059455256320] mod_rewrite.c(483): [client 197.37.110.119:59415] 197.37.110.119 - - [www.customsite.com/sid#13141e8][rid#7f620c01a100/initial] pass through /images/e-learn2.png, referer: https://www.customsite.com/login
[Mon Sep 30 11:59:53.670419 2019] [rewrite:trace2] [pid 5473:tid 140059353282304] mod_rewrite.c(483): [client 197.37.110.119:59413] 197.37.110.119 - - [www.customsite.com/sid#13141e8][rid#7f620c01fcd0/initial] init rewrite engine with requested uri /images/bg7.png, referer: https://www.customsite.com/css/auth.css
[Mon Sep 30 11:59:53.670441 2019] [rewrite:trace1] [pid 5473:tid 140059353282304] mod_rewrite.c(483): [client 197.37.110.119:59413] 197.37.110.119 - - [www.customsite.com/sid#13141e8][rid#7f620c01fcd0/initial] pass through /images/bg7.png, referer: https://www.customsite.com/css/auth.css
i have Centos 7 with Centos Web Panel installed, & the script is running on nodejs so i am proxying nodejs to port 80 using the following
ProxyPass / http://127.0.0.1:4000/
ProxyPassReverse / http://127.0.0.1:4000/
the problem is that the website no matter any htaccess code nor redirect within apache it is always opening "https://www.customsite.com"
i need it to be without www & only within https
why this doesnt work ? this is getting me very crazy !!
any help will be appreciated
thanks in advance for eveyone,,
i used mod env to redirect instead of htaccess,
thanks for all

.htaccess error in Codeigniter3

I have a website files in hosting account. And here is this .htaccess file in the root of directory
RewriteEngine on
RewriteCond $1 !^(index\.php|assets|images|js|css|uploads|favicon.png)
RewriteCond %(REQUEST_FILENAME) !-f
RewriteCond %(REQUEST_FILENAME) !-d
RewriteRule ^(.*)$ ./index.php?/$1 [L]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}
#AddHandler application/x-httpd-php56 .php .php5 .php4 .php3
Also, I added a new website folder 'nigaratakishizadeh.com' to the root and uploaded my CI files there. When I enter the website ( http://nigaratakishizadeh.com ), it gives me an error 500 Internal
500 - Internal Server Error This is a temporary server error. Please
try to reload the webpage later.
However, when I change nigaratakishizadeh.com folder's htaccess to RewriteEngine off, it opens the website. What is the problem?
Here is my .htaccess file in the nigaratakishizadeh.com directory:
RewriteEngine on
RewriteCond $1 !^(index\.php|assets|images|js|css|uploads|favicon.png)
RewriteCond %(REQUEST_FILENAME) !-f
RewriteCond %(REQUEST_FILENAME) !-d
RewriteRule ^(.*)$ ./index.php/$1 [L]
php_value upload_max_filesize 30M
Here is the server apache error logs:
[Sun Apr 29 08:16:29.548592 2018] [core:alert] [pid 33453] [client 181.224.135.93:39158] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Sun Apr 29 08:16:29.341526 2018] [core:alert] [pid 38466] [client 181.224.135.93:39098] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Sun Apr 29 08:16:27.622224 2018] [core:alert] [pid 43795] [client 181.224.135.93:38904] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Sun Apr 29 08:16:27.261333 2018] [core:alert] [pid 42837] [client 181.224.135.93:38864] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Sun Apr 29 08:16:23.581238 2018] [core:alert] [pid 38407] [client 181.224.135.93:38614] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Sun Apr 29 08:16:22.294281 2018] [core:alert] [pid 38523] [client 181.224.135.93:38538] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Sun Apr 29 08:16:20.994017 2018] [core:alert] [pid 38526] [client 181.224.135.93:38430] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Sun Apr 29 08:16:20.778064 2018] [core:alert] [pid 36546] [client 181.224.135.93:38378] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Sun Apr 29 08:16:20.778064 2018] [core:alert] [pid 38523] [client 181.224.135.93:38376] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration, referer: http://nigaratakishizadeh.com/
[Sun Apr 29 08:16:20.042254 2018] [core:alert] [pid 42837] [client 181.224.135.93:38276] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration, referer: http://nigaratakishizadeh.com/
[Sun Apr 29 08:16:20.009329 2018] [core:alert] [pid 33453] [client 181.224.135.93:38266] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Sun Apr 29 08:16:19.804285 2018] [core:alert] [pid 38528] [client 181.224.135.93:38236] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration, referer: http://nigaratakishizadeh.com/
[Sun Apr 29 08:16:19.742617 2018] [core:alert] [pid 38527] [client 181.224.135.93:38228] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Sun Apr 29 08:16:19.535860 2018] [core:alert] [pid 38526] [client 181.224.135.93:38124] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration, referer: http://nigaratakishizadeh.com/
[Sun Apr 29 08:16:19.178688 2018] [core:alert] [pid 38528] [client 181.224.135.93:38038] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Sun Apr 29 08:16:18.973287 2018] [core:alert] [pid 38466] [client 181.224.135.93:37990] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration, referer: http://nigaratakishizadeh.com/
[Sun Apr 29 08:16:18.383334 2018] [core:alert] [pid 38526] [client 181.224.135.93:37862] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Sun Apr 29 08:16:18.173713 2018] [core:alert] [pid 42837] [client 181.224.135.93:37826] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration, referer: http://nigaratakishizadeh.com/
[Sun Apr 29 08:16:06.847039 2018] [core:alert] [pid 38523] [client 181.224.135.93:35942] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Sun Apr 29 08:16:05.703058 2018] [core:alert] [pid 33453] [client 181.224.135.93:35858] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration, referer: http://nigaratakishizadeh.com/
[Sun Apr 29 08:16:05.101583 2018] [core:alert] [pid 38527] [client 181.224.135.93:35786] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Sun Apr 29 08:16:04.895922 2018] [core:alert] [pid 42837] [client 181.224.135.93:35756] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration, referer: http://nigaratakishizadeh.com/
[Sun Apr 29 08:16:04.391211 2018] [core:alert] [pid 38526] [client 181.224.135.93:35702] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Sun Apr 29 08:16:04.122189 2018] [core:alert] [pid 42837] [client 181.224.135.93:35648] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration, referer: http://nigaratakishizadeh.com/
[Sun Apr 29 08:16:03.218603 2018] [core:alert] [pid 38526] [client 181.224.135.93:35530] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Sun Apr 29 08:11:50.044065 2018] [core:alert] [pid 7912] [client 181.224.135.93:33050] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: </IfModule without matching <IfModule section
[Sun Apr 29 08:11:48.010489 2018] [core:alert] [pid 7912] [client 181.224.135.93:60890] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: </IfModule without matching <IfModule section
[Sun Apr 29 08:11:47.751755 2018] [core:alert] [pid 14231] [client 181.224.135.93:60852] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: </IfModule without matching <IfModule section
[Sun Apr 29 08:11:46.422532 2018] [core:alert] [pid 2990] [client 181.224.135.93:60692] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: </IfModule without matching <IfModule section
[Sun Apr 29 08:11:19.255974 2018] [core:alert] [pid 12220] [client 181.224.135.93:56988] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: </IfModule without matching <IfModule section
[Sun Apr 29 08:11:15.718812 2018] [core:alert] [pid 2522] [client 181.224.135.93:56666] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: </IfModule without matching <IfModule section
[Sun Apr 29 08:11:15.490073 2018] [core:alert] [pid 12918] [client 181.224.135.93:56638] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: </IfModule without matching <IfModule section
[Sun Apr 29 08:11:15.320300 2018] [core:alert] [pid 8370] [client 181.224.135.93:56608] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: </IfModule without matching <IfModule section
[Sun Apr 29 08:11:14.989071 2018] [core:alert] [pid 12918] [client 181.224.135.93:56570] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: </IfModule without matching <IfModule section
[Sun Apr 29 08:11:10.808651 2018] [core:alert] [pid 12918] [client 181.224.135.93:56064] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: </IfModule without matching <IfModule section
[Sun Apr 29 08:11:10.426044 2018] [core:alert] [pid 12918] [client 181.224.135.93:56020] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: </IfModule without matching <IfModule section
[Sun Apr 29 08:11:09.269472 2018] [core:alert] [pid 12220] [client 181.224.135.93:55938] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: </IfModule without matching <IfModule section
[Sun Apr 29 08:11:08.937889 2018] [core:alert] [pid 2828] [client 181.224.135.93:55904] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: </IfModule without matching <IfModule section
[Sun Apr 29 08:11:08.323260 2018] [core:alert] [pid 2522] [client 181.224.135.93:55872] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: </IfModule without matching <IfModule section
[Sun Apr 29 08:10:33.954696 2018] [core:alert] [pid 56003] [client 181.224.135.93:53066] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Sun Apr 29 08:10:28.173501 2018] [core:alert] [pid 7912] [client 181.224.135.93:52686] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Sun Apr 29 08:10:27.670770 2018] [core:alert] [pid 2990] [client 181.224.135.93:52664] /home/javid020/public_html/nigaratakishizadeh.com/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration
[Sun Apr 29 08:09:37.739238 2018] [core:alert] [pid 2990] [client 181.224.135.93:51750] /home/javid020/public_html/.htaccess: </IfModule without matching <IfModule section
[Sun Apr 29 08:09:34.847641 2018] [core:alert] [pid 2990] [client 181.224.135.93:51550] /home/javid020/public_html/.htaccess: </IfModule without matching <IfModule section
[Sun Apr 29 08:09:34.640236 2018] [core:alert] [pid 45433] [client 181.224.135.93:51530] /home/javid020/public_html/.htaccess: </IfModule without matching <IfModule section, referer: https://www.wtf.az/courses
[Sun Apr 29 08:09:33.541211 2018] [core:alert] [pid 3110] [client 181.224.135.93:51446] /home/javid020/public_html/.htaccess: </IfModule without matching <IfModule section
[Sun Apr 29 08:09:33.321420 2018] [core:alert] [pid 50479] [client 181.224.135.93:51440] /home/javid020/public_html/.htaccess: </IfModule without matching <IfModule section, referer: https://www.wtf.az/courses
[Sun Apr 29 08:09:33.124587 2018] [core:alert] [pid 2828] [client 181.224.135.93:51426] /home/javid020/public_html/.htaccess: </IfModule without matching <IfModule section
[Sun Apr 29 08:09:32.919041 2018] [core:alert] [pid 7834] [client 181.224.135.93:51408] /home/javid020/public_html/.htaccess: </IfModule without matching <IfModule section, referer: https://www.wtf.az/courses
[Sun Apr 29 08:09:32.820198 2018] [core:alert] [pid 3110] [client 181.224.135.93:51402] /home/javid020/public_html/.htaccess: </IfModule without matching <IfModule section
[Sun Apr 29 08:09:13.463839 2018] [core:alert] [pid 45433] [client 181.224.135.93:49724] /home/javid020/public_html/.htaccess: </IfModule without matching <IfModule section
[Sun Apr 29 08:09:13.320793 2018] [core:alert] [pid 3110] [client 181.224.135.93:49716] /home/javid020/public_html/.htaccess: </IfModule without matching <IfModule section
[Sun Apr 29 08:09:13.258574 2018] [core:alert] [pid 2990] [client 181.224.135.93:49710] /home/javid020/public_html/.htaccess: </IfModule without matching <IfModule section, referer: https://www.wtf.az/courses
[Sun Apr 29 08:09:12.506714 2018] [core:alert] [pid 2990] [client 181.224.135.93:49654] /home/javid020/public_html/.htaccess: </IfModule without matching <IfModule section, referer: https://www.wtf.az/courses
[Sun Apr 29 08:09:11.796429 2018] [core:alert] [pid 2828] [client 181.224.135.93:49580] /home/javid020/public_html/.htaccess: </IfModule without matching <IfModule section
[Sun Apr 29 08:09:10.569661 2018] [core:alert] [pid 39620] [client 181.224.135.93:49444] /home/javid020/public_html/.htaccess: </IfModule without matching <IfModule section, referer: https://www.wtf.az/courses
[Sun Apr 29 08:09:09.945440 2018] [core:alert] [pid 39620] [client 181.224.135.93:49404] /home/javid020/public_html/.htaccess: </IfModule without matching <IfModule section
There can be different reason behind it (like you have not loaded rewrite_module). Check your server's apache error log for detail about this error & take action accordingly.
Then you can add some condition with code like
<IfModule mod_rewrite.c>
SetEnv HTTP_MOD_REWRITE On
RewriteEngine on
RewriteCond $1 !^(index\.php|assets|images|js|css|uploads|favicon.png)
RewriteCond %(REQUEST_FILENAME) !-f
RewriteCond %(REQUEST_FILENAME) !-d
RewriteRule ^(.*)$ ./index.php?/$1 [L]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}
#AddHandler application/x-httpd-php56 .php .php5 .php4 .php3
</IfModule >
Every Line in your .htaccess file is correct.
you are getting 500 - Internal server error because you do not have permission to set these values by .htaccess.
You have to contact your web server providers and ask to set AllowOverride Options for your host or to put these lines in their virtual host configuration file.
see the Apache AllowOverride directive

problems by User URL - htacces

this is so that I get an error when I work with preatashop, and I get a 404 error and I can not possibly see the error.
error on my hosting are here:
[Tue Mar 18 16:29:31.837809 2014] [:error] [pid 381031] [client 188.181.88.9:42136]
SoftException in Application.cpp:601: Directory "/home/jesperbo/public_html/shop-bo.dk/modules" is writeable by group, referer: http://www.shop-bo.dk/index.php
[Tue Mar 18 16:23:45.421181 2014] [:error] [pid 375394] [client 183.81.54.21:40210] SoftException in Application.cpp:601: Directory "/home/jesperbo/public_html/shop-bo.dk/modules" is writeable by group, referer: http://www.shop-bo.dk/admin123/index.php?controller=AdminModules&token=52745cf84f136fef00d2738ad3be8887&configure=blockadvfooter&tab_module=others&module_name=blockadvfooter
[Tue Mar 18 16:22:34.397894 2014] [:error] [pid 373007] [client 183.81.54.21:39642] SoftException in Application.cpp:601: Directory "/home/jesperbo/public_html/shop-bo.dk/modules" is writeable by group, referer: http://www.shop-bo.dk/admin123/index.php?controller=AdminModules&token=52745cf84f136fef00d2738ad3be8887&configure=blockadvfooter&tab_module=others&module_name=blockadvfooter
[Tue Mar 18 16:20:13.975016 2014] [:error] [pid 368791] [client 188.181.88.9:38718] SoftException in Application.cpp:601: Directory "/home/jesperbo/public_html/shop-bo.dk/modules" is writeable by group, referer: http://www.shop-bo.dk/admin123/index.php?controller=AdminModules&token=c743f4f33c0588a21fa3880e5772bf6c&configure=blockadvfooter&tab_module=others&module_name=blockadvfooter
[Tue Mar 18 16:19:35.680863 2014] [:error] [pid 368791] [client 183.81.54.21:38415] SoftException in Application.cpp:601: Directory "/home/jesperbo/public_html/shop-bo.dk/modules" is writeable by group, referer: http://www.shop-bo.dk/index.php
[Tue Mar 18 16:19:32.283604 2014] [:error] [pid 367335] [client 183.81.54.21:38408] SoftException in Application.cpp:601: Directory "/home/jesperbo/public_html/shop-bo.dk/modules" is writeable by group
[Tue Mar 18 16:18:58.956017 2014] [:error] [pid 371329] [client 183.81.54.21:38290] SoftException in Application.cpp:601: Directory "/home/jesperbo/public_html/shop-bo.dk/modules" is writeable by group, referer: http://www.shop-bo.dk/admin123/index.php?controller=AdminModules&token=52745cf84f136fef00d2738ad3be8887&configure=blockadvfooter&tab_module=others&module_name=blockadvfooter
[Tue Mar 18 16:18:54.456715 2014] [:error] [pid 369337] [client 188.181.88.9:38293] SoftException in Application.cpp:601: Directory "/home/jesperbo/public_html/shop-bo.dk/modules" is writeable by group, referer: http://www.shop-bo.dk/index.php
[Tue Mar 18 16:18:33.148207 2014] [:error] [pid 369336] [client 183.81.54.21:38191] SoftException in Application.cpp:601: Directory "/home/jesperbo/public_html/shop-bo.dk/modules" is writeable by group, referer: http://www.shop-bo.dk/index.php
[Tue Mar 18 16:18:24.373591 2014] [:error] [pid 359359] [client 183.81.54.21:38139] SoftException in Application.cpp:601: Directory "/home/jesperbo/public_html/shop-bo.dk/modules" is writeable by group, referer: http://www.shop-bo.dk/index.php
[Tue Mar 18 16:18:18.820409 2014] [:error] [pid 368791] [client 183.81.54.21:38121] SoftException in Application.cpp:601: Directory "/home/jesperbo/public_html/shop-bo.dk/modules" is writeable by group
[Tue Mar 18 16:17:52.208217 2014] [:error] [pid 369336] [client 183.81.54.21:37992] SoftException in Application.cpp:601: Directory "/home/jesperbo/public_html/shop-bo.dk/modules" is writeable by group, referer: http://www.shop-bo.dk/index.php
[Tue Mar 18 16:17:45.449577 2014] [:error] [pid 368791] [client 183.81.54.21:37955] SoftException in Application.cpp:601: Directory "/home/jesperbo/public_html/shop-bo.dk/modules" is writeable by group
[Tue Mar 18 16:17:32.821418 2014] [:error] [pid 369336] [client 183.81.54.21:37852] SoftException in Application.cpp:601: Directory "/home/jesperbo/public_html/shop-bo.dk/modules" is writeable by group
[Tue Mar 18 16:16:23.042423 2014] [:error] [pid 367335] [client 183.81.54.21:37511] SoftException in Application.cpp:601: Directory "/home/jesperbo/public_html/shop-bo.dk/modules" is writeable by group
[Tue Mar 18 16:15:57.751759 2014] [:error] [pid 367335] [client 183.81.54.21:37445] SoftException in Application.cpp:601: Directory "/home/jesperbo/public_html/shop-bo.dk/modules" is writeable by group
[Tue Mar 18 16:15:49.707305 2014] [:error] [pid 361467] [client 188.181.88.9:37419] SoftException in Application.cpp:601: Directory "/home/jesperbo/public_html/shop-bo.dk/modules" is writeable by group
[Tue Mar 18 16:15:38.862260 2014] [:error] [pid 369137] [client 183.81.54.21:37391] SoftException in Application.cpp:601: Directory "/home/jesperbo/public_html/shop-bo.dk/modules" is writeable by group
I have set to be user-friendly URL - htacces
my .htaccess its here:
# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution
# http://www.prestashop.com - http://www.prestashop.com/forums
<IfModule mod_rewrite.c>
SetEnv HTTP_MOD_REWRITE On
RewriteEngine on
RewriteCond %{HTTP_HOST} ^demo4leotheme.com$
RewriteRule . - [E=REWRITEBASE:/prestashop/leo_mobile/]
RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]
# AlphaImageLoader for IE and fancybox
RewriteCond %{HTTP_HOST} ^demo4leotheme.com$
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]
</IfModule>
#If rewrite mod isn't enabled
ErrorDocument 404 /prestashop/leo_mobile/index.php?controller=404
# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
Your error.log shows something important:
Directory "/home/jesperbo/public_html/shop-bo.dk/modules" is writeable by group
Fix this error by changing your permissions using this chmod command:
chmod g-w /home/jesperbo/public_html/shop-bo.dk/modules

Making nice Urls in Yii

I red a lot of tuttorials, but all lead me to the same error - Error 500 - Either the server is overloaded or there was an error in a CGI script.
I'm using xampp on Windows and cofigured httpd.conf like this
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Allow from all
</Directory>
changed in yii main.php
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'caseSensitive'=>false,
'rules'=>array(
'' => 'site/index',
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
and added .htaccess in root folder (the same level where protected folder)
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
RewriteBase /tests/
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
But no matter what I write in .htaccess, I get this error. When I commented all out, links from yii are generated ok (without index.php), but then I have 404 error, because of wrong server configuration.
EDIT:
And error.log last few records:
[Wed Nov 27 11:32:31.100063 2013] [core:alert] [pid 9520:tid 1572] [client ::1:58620] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess: Options not allowed here
[Wed Nov 27 11:32:31.372163 2013] [core:alert] [pid 9520:tid 1572] [client ::1:58621] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess: Options not allowed here
[Wed Nov 27 11:32:34.674379 2013] [core:alert] [pid 9520:tid 1572] [client ::1:58622] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess: Options not allowed here
[Wed Nov 27 11:32:36.587084 2013] [core:alert] [pid 9520:tid 1572] [client ::1:58623] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess: Options not allowed here
[Wed Nov 27 11:32:54.899832 2013] [core:alert] [pid 9520:tid 1572] [client ::1:58624] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess: Options not allowed here
[Wed Nov 27 11:54:14.056192 2013] [core:alert] [pid 9520:tid 1572] [client ::1:59297] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess: Options not allowed here
[Wed Nov 27 11:54:14.687425 2013] [core:alert] [pid 9520:tid 1572] [client ::1:59298] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess: Options not allowed here
[Wed Nov 27 15:53:27.459885 2013] [ssl:warn] [pid 11320:tid 308] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Wed Nov 27 15:53:27.525911 2013] [core:warn] [pid 11320:tid 308] AH00098: pid file C:/Users/kristineg/xamps/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Wed Nov 27 15:53:27.588934 2013] [ssl:warn] [pid 11320:tid 308] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Wed Nov 27 15:53:27.625947 2013] [mpm_winnt:notice] [pid 11320:tid 308] AH00455: Apache/2.4.4 (Win32) OpenSSL/1.0.1e PHP/5.5.1 configured -- resuming normal operations
[Wed Nov 27 15:53:27.625947 2013] [mpm_winnt:notice] [pid 11320:tid 308] AH00456: Server built: Feb 23 2013 12:42:00
[Wed Nov 27 15:53:27.625947 2013] [core:notice] [pid 11320:tid 308] AH00094: Command line: 'c:\users\kristineg\xamps\apache\bin\httpd.exe -d C:/Users/kristineg/xamps/apache'
[Wed Nov 27 15:53:27.627948 2013] [mpm_winnt:notice] [pid 11320:tid 308] AH00418: Parent: Created child process 4472
[Wed Nov 27 15:53:27.998083 2013] [ssl:warn] [pid 4472:tid 336] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Wed Nov 27 15:53:28.143138 2013] [ssl:warn] [pid 4472:tid 336] AH01909: RSA certificate configured for www.example.com:443 does NOT include an ID which matches the server name
[Wed Nov 27 15:53:28.186154 2013] [mpm_winnt:notice] [pid 4472:tid 336] AH00354: Child: Starting 150 worker threads.
[Wed Nov 27 15:53:38.827074 2013] [core:alert] [pid 4472:tid 1640] [client ::1:61797] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess: Options not allowed here
[Wed Nov 27 15:53:39.614364 2013] [core:alert] [pid 4472:tid 1652] [client ::1:61796] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess: Options not allowed here
[Wed Nov 27 15:53:39.958491 2013] [core:alert] [pid 4472:tid 1640] [client ::1:61798] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess: Options not allowed here
[Wed Nov 27 15:53:40.295616 2013] [core:alert] [pid 4472:tid 1652] [client ::1:61799] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess: Options not allowed here
[Wed Nov 27 16:32:32.894114 2013] [core:alert] [pid 4472:tid 1640] [client ::1:62407] C:/Users/kristineg/xamps/htdocs/xampp/tests/.htaccess: Options not allowed here
I think you don't have the mode_rewrite module loaded in your server's main config. For starters, modify your .htaccess so it looks like this:
IndexIgnore */*
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /tests/
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
</IfModule>
If things change for the better (i.e. no 500-errors), see your main httpd.conf and look for a line that starts like this:
#LoadModule rewrite_module ...
Uncomment that line by removing the leading # and restart the server process.
As for the "Options not allowed here" error, see this answer.

Resources