You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the great addition to the EE community!
I'm having an issue when I try to force trailing slashes using some .htaccess rules. When I add the appropriate rules I get an error of:
A Database Error Occurred
Unable to connect to your database server using the provided settings.
Filename: core/EE_Config.php
Line Number: 211
The error only occurs when I try to access a URL that doesn't have a trailing slash. When I do that I get redirected to appropriate URL (with a trailing slash) but on port 7080. Example:
Also, I'm currently working on the site using dedicated IP address instead of the final domain name. So that might have something to do with it, but I'm not entirely sure.
Have you encountered this before?
The text was updated successfully, but these errors were encountered:
Thanks for the great addition to the EE community!
You bet! Thanks for the appreciation :)
I'm having an issue when I try to force trailing slashes using some .htaccess rules. ... Have you encountered this before?
No, I can't say I have.
The primary issue is that you're matching an environment on a specific IP address and your .htaccess rule is redirecting to the IP plus port number which fails on the PHP switch statement. Why you're getting redirected there - I can't say. Your redirect match is somewhat odd though, can you try being a bit more "loose" in your match? Give this a try if you can:
# Make sure it's not a directory root
RewriteCond %{REQUEST_FILENAME} !-d
# Catch any+all characters and throw a slash in as the last character
RewriteCond %{REQUEST_URI} ^(.+)/$
# Redirect to same URI sans trailing slash (and use 301 for SEO goodness)
RewriteRule ^(.+)/$ /$1 [R=301,L]
@brettdewoody - just wanted to ping you on this to see if you'd been notified by GitHub about my reply. I'm not familiar enough with how GitHub does email notifications.
Thanks for the great addition to the EE community!
I'm having an issue when I try to force trailing slashes using some .htaccess rules. When I add the appropriate rules I get an error of:
The error only occurs when I try to access a URL that doesn't have a trailing slash. When I do that I get redirected to appropriate URL (with a trailing slash) but on port 7080. Example:
If I try to access:
http://mydomain.com/something/else
I get redirected to:
http://mydomain.com:7080/something/else/
And then the database error is shown.
Here are the .htaccess rules I'm using for removing the trailing slashes:
If I remove those 3 lines everything works fine.
Also, I'm currently working on the site using dedicated IP address instead of the final domain name. So that might have something to do with it, but I'm not entirely sure.
Have you encountered this before?
The text was updated successfully, but these errors were encountered: