I've gone through and check other questions that have answers and can't seem to find what I'm looking for anywhere. Here are the options that I've tried so far...
This answer, this one and this one.
My problem right now is that when I go to example.com/account/
, it goes to a 404 not found page. However when I go to example.com/account/1/
it loads the page as expected. Below is my current htaccess as it stands. I've tried all sorts of variations and nothing seems to work.
# .htaccess file
RewriteEngine on
Options -MultiViews +FollowSymLinks
# Rerwite the domain
RewriteCond %{HTTP_HOST} !^example.com [NC]
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
# Rewrite conditions for each page type
RewriteCond /%{REQUEST_FILENAME} !-d
RewriteCond /%{REQUEST_FILENAME}.php -f
RewriteRule ^([a-zA-Z0-9-]+)/$ /index.php?page=$1 [L]
RewriteCond /%{REQUEST_FILENAME} !-d
RewriteCond /%{REQUEST_FILENAME}.php -f
RewriteRule ^([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)/$ /index.php?page=$1&id=$2 [L]
# Disallow access to both this file and the config file
<Files .htaccess>
order allow,deny
deny from all
</Files>
<Files config.php>
order allow,deny
deny from all
</Files>
# Various error pages
ErrorDocument 300 /error/
ErrorDocument 400 /error/
ErrorDocument 403 /error/
ErrorDocument 404 /error/
ErrorDocument 408 /error/
ErrorDocument 500 /error/
ErrorDocument 503 /error/
Just as a note, I've edited the main domain rewrites to example.com as this site is in development and can't be public. So ignore that bit.