Error 500

Website URL

https://www.gr8brik.rf.gd/user/[ANY USER PROFILE]

https://www.gr8brik.rf.gd/[ANY PAGE THAT DOES NOT EXIST]

https://www.gr8brik.rf.gd/home

Error Message

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

Other Information

Htaccess:

php_value display_errors Off
php_value mbstring.http_input auto
php_value date.timezone America/New_York
RewriteBase /
RewriteEngine On

# Force HTTPS
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Redirect non-www to www
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# Redirect all requests to PHP files, except for specific extensions
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.(png|jpg|gif|jpeg|css|js)$
RewriteRule ^(.*)$ $1.php [L]

# RewriteRule \.(html|htm)$ $1.php [L]

# Redirect errors to error page
ErrorDocument 403 /error.php?error=403
ErrorDocument 404 /error.php?error=404
ErrorDocument 500 /error.php?error=500

Other rewrite rules

# RewriteRule ^user/([a-zA-Z0-9_]+)$ /profile.php?user=$1 [L]
# RewriteRule ^home/ /index.php [L]
# ErrorDocument 503 "<b>GR8BRIK is having issues right now. Check back soon.</b>
# Redirect 503 /
# Redirect /home /index.php
Redirect /user /profile.php?user=$1

Is anyone going to help me with this? My homepage will not work.

Please read

4 Likes

Sure, but please understand that this is a community forum, and it can take some time for people to see your message and reply.


I suspect the problem is caused by these .htaccess rules:

# Redirect all requests to PHP files, except for specific extensions
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.(png|jpg|gif|jpeg|css|js)$
RewriteRule ^(.*)$ $1.php [L]

What this will do if you go to https://www.gr8brik.rf.gd/home, then this last line will rewrite the request to home.php. But this file does not exist, so it won’t work.

To fix this, you could add this line just above the RewriteRule line:

RewriteCond %{REQUEST_FILENAME}.php -f

This will make it so that this code is only applied the specified PHP file exists. If not, it will fall back to the standard 404 Not Found logic.


I see two issues here:

The “redirect all requests” logic from above is placed above the /user specific code, so it will be applied first. So when you try to access /user/123 or /user/example, the server will look for a file /user/123.php and /user/example.php respectively.

Also, the Redirect rule you have there is invalid. You have a $1 in the redirect target. But $1 is supposed to be the result of a matching expression in the first part, and right now there is no expression, and if there was, it wouldn’t work because Redirect does not support expression.

The commented out line at the top actually seems a lot more likely to work to me:

RewriteRule ^user/([a-zA-Z0-9_]+)$ /profile.php?user=$1 [L]
5 Likes