I have searched and searched on this site and I still am unable to find an article that can help me with my issue. Any help will be extremely appreciated.
SiteDocs.php is definitely there and pulling up correctly.
The problem is I have multiple sites, and they each have different versions of apache or could potentiality at least. On one server, these rules work perfectly. On another the trailing slashes will not redirect.
If it doesn’t work for Apache 1.x, then prepend RewriteEngine on. ScallioXTX’s code is correct and he’s allowed you to have alternate capitalization on the D|d in SiteDocs, too!
Multiviews is a MAJOR PITA and should be done away with, IMHO.
Apache 1.x REQUIRES a leading / after the start anchor so yor first RewriteRule needs a / and the /? makes it optional (so it’ll still work with Apache 2.x).
# core directives first - technique
Options -MultiViews
RewriteEngine on
RewriteRule ^[COLOR="Red"]/?[/COLOR]([0-9]+)/(.+)$ /Default.php?ID=$1
RewriteRule ^/?([Dd]ocuments|[Ss]ite[Dd]ocs)/?$ SiteDocs.php
As for 1&1, the last thing I knew was that they didn’t allow mod_rewrite so I’m pleasantly surprised that they are allowing it (along with .htaccess). I assume that you DO have it working with other code, don’t you?
The difference with the trailing / is with the “support files,” i.e., relative links will shift directory level for every trailing / you include. Remember, Apache received a request to a specific directory level within your DocumentRoot. If your redirections change that level, your relative links will still be to the level specified by the request UNLESS you use absolute links or the HTML <base> tag (see signature tutorial for format). In other words, the redirection works but the css, js, images, etc will all be missing if you don’t handle this correctly (within the SiteDocs.php script)
The solution XDX gave me doesn’t work at all on 1and1 (not that I am not thankful or anything as I most certainty am). 1and1 allows for me to upload the .htaccess file, and I am using it just fine, except of course it will not allow me to do many things. I have tried your code on some other servers and it works fine. So I guess the issue lies with 1and1
This is the only code that I have that performs this function. I guess I will just have to make due with what is allowed to be done on 1and1 and not worry about the rest. I just really wanted to be able to put that trailing slash on there, Which I cannot on 1and1