.httaccess - 500 Internal Server Error
Hi
An user move his site to my VPS and shows Internal server error, but when i remove the httaccess, the site looks good, but the rewriter doesnt work. here is the httacces file content.
php_value max_input_vars 5000
php_value session.gc_maxlifetime 10800
php_value register_globals Off
ErrorDocument 404 /404
RewriteEngine on
## EXPIRES CACHING ##
#
#ExpiresActive On
#ExpiresByType image/jpg "access plus 1 month"
#ExpiresByType image/jpeg "access plus 1 month"
#ExpiresByType image/gif "access plus 1 month"
#ExpiresByType image/png "access plus 1 month"
#ExpiresByType text/css "access plus 1 month"
#ExpiresByType text/javascript "access plus 1 month"
#ExpiresByType application/pdf "access plus 1 month"
#ExpiresByType text/x-javascript "access plus 1 month"
#ExpiresByType application/x-shockwave-flash "access plus 1 month"
#ExpiresByType image/x-icon "access plus 1 year"
#ExpiresDefault "access plus 7 days"
#
## EXPIRES CACHING ##
# stuff to let through (ignore)
RewriteCond %{REQUEST_URI} "/admin/" [OR]
RewriteCond %{REQUEST_URI} "/new_admin/" [OR]
RewriteCond %{REQUEST_URI} "/includes/" [OR]
RewriteCond %{REQUEST_URI} "/tunnel.php"
RewriteRule (.*) $1 [L]
# REDIRECT TO ADMIN/LOGIN
RewriteCond %{REQUEST_URI} ^/administration$
RewriteRule ^(.*)$ https://www.example.com.mx/admin/login? [r=301,L]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{SERVER_PORT} !^443
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_URI} ^/our-program$
RewriteRule ^(.*)$ /our-program/about? [r=301,L]
RewriteCond %{REQUEST_URI} ^/franchises$
RewriteRule ^(.*)$ /franchises/become-a-franchisee? [r=301,L]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{SERVER_PORT} !^443
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
##### ATTEMPT TO SEE IF I CAN MAP page=XX TO THE CORRENT FRIENDLY URL
RewriteRule ^([^.]+)?$ index.php?arg1=$1 [QSA]
RewriteRule \.(?:doc|docx|xls|xlsx|pdf|txt|cad|zip|rar)$ filehandler.php [QSA,L,NC]
RewriteRule \.(?:jpeg|jpg|png|ico)$ convertProgressive.php
RewriteRule ^sitemap.xml$ sitemap.php [nc]
#Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a -
Hello :) Please post the output to /usr/local/apache/logs/error_log when you notice the "500" error code in your browser. Thank you. 0 -
I removed the three first lines and everything is fine! Why? the site works at 100% 0 -
It's likely you are using the suPHP handler for PHP which does not support the use of the "php_value" flag in the .htaccess file. You should instead copy /usr/local/lib/php.ini to the account's home directory and adjust your custom php values accordingly. Thank you. 0 -
Could you please tell me the comands to do this? Or how do it? Thanks for all! 0 -
Could you please tell me the comands to do this? Or how do it? Thanks for all!
Yes, here are the commands:cp -a /usr/local/lib/php.ini /home/$username/public_html/ chown $username.$username /home/$username/public_html/php.ini vi /home/$username/public_html/php.ini
Replace "$username" with the username of the account. The last command invokes "vi" and allows you to modify the php.ini file for the individual account: How to Use the vi Editor Thank you.0 -
Could you provide more details about what happens when you attempt to access your admin page? The php.ini file should not prevent it from loading. Thank you. 0 -
What happens .... when i try to acces only changes de url, just adds the s500.html 0 -
What happens .... when i try to acces only changes de url, just adds the s500.html
Is there any new output to /usr/local/apache/logs/error_log when this happens? Thank you.0 -
Hello I need support and this is the error of my server : [Tue Oct 28 07:56:30.457572 2025] [cgid:error] [pid 13329:tid 13411] [client 167.94.146.53:48734] AH01265: stderr from /home/tawilati/public_html/driver/cgi-bin/: attempt to invoke directory as script, referer: http://redacted.domain.
0 -
Hasan ALTuhamey - this thread was 9 years old, so you should really be making a new thread for your issue.
Could you start a new thread with more context about your issue, such as how you discovered the error and what work let to it? This is likely an issue with the ScriptAlias line for the domain, so any customizations to the vhosts would also be relevant here.
0
Please sign in to leave a comment.
Comments
11 comments