Control Web Panel
WebPanel => CentOS-WebPanel Bugs => Topic started by: devrim on January 23, 2022, 06:02:00 PM
-
Hi
Rewrite in my .htaccess file gives 500 internal server error. can you help me please.
.htaccess codes
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
# Send request via index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
<FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css|css)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
-
Do this instead:
Options +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.EXAMPLE\.TLD[NC]
RewriteRule ^(.*)$ http://EXAMPLE.TLD/$1 [L,R=301,NC]
# Send request via index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
<FilesMatch "\.(ttf|ttc|otf|eot|woff|font.css|css)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
Change EXAMPLE and TLD to your domain name.
Also check the domlogs to see what's actually wrong. The logs will say which line is giving error 500:
tail -f /usr/local/apache/domlogs/YourDomain
-
my daily error codes
Options FollowSymLinks not allowed
I did some research but it's very complicated. What should I do with an example?
-
my daily error codes
Options FollowSymLinks not allowed
I did some research but it's very complicated. What should I do with an example?
It's not complicated at all. Remove this line:
Options +FollowSymLinks
or change it to:
Options +SymLinksIfOwnerMatch
I'm wondering why you are even using this, as it is potentially a security issue. SymLinksIfOwnerMatch is better for security.
The reason for getting this error is because the apache template you are using does not let you control the "Options" variable for "FollowSymLinks" because it's not defined in there that you are allowed to:
<Directory "%docroot%">
Options -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
</Directory>
-
Options +SymLinksIfOwnerMatch this code worked for me but gave sql error.
The sql file cannot be dumped with the user added in mysql.
but if we select the user as root, it loads and works.
-
Options +SymLinksIfOwnerMatch this code worked for me but gave sql error.
The sql file cannot be dumped with the user added in mysql.
but if we select the user as root, it loads and works.
Ok, then remove it as well:
Options +SymLinksIfOwnerMatch
Do you want/need it?