RewriteEngine On
# RewriteBase /
# NOT needed unless you're using mod_alias to redirect
RewriteCond %{HTTP_HOST} ^mysite\\.net [NC]
RewriteRule [COLOR="Red"]/?[/COLOR](.*) http://www.mysite.net/$1 [R=301,L]
# Okay, just redirects mysite.net to www.mysite.net
# <IfModule mod_rewrite.c>
# That was ONLY to protect you from 500 errors
# if your server did not have mod_rewrite enabled
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# If the file doesn't exist AND
# If the directory doesn't exist THEN
# Redirect to index.php
#</IfModule>
# Ditto
In other words, there is NO reason for this “canned” code to otherwise affect your server.
Thank you for your reply. Your comments help me get an idea of the basics functions!
I really want to learn the basics, it is a big challenge for me to just wrap my head around the idea. I have always found coding a little intimidating!
I am not too sure what you mean by “canned code”?
The part that wordpress automatically inserted?
I have been trying to find documentation that spells out in simple terms what
It is EXTREMELY bad coding practice to use (.) to capture something for which regex can be written. This is because (.) will capture nothing-to-everything which, for the unwary, will cause looping of the code. In your case, (.*) was appropriate.
The ^/? at the start of regex signifies a start of the {REQUEST_URI} string with an OPTIONAL (the ?) slash (/). This is necessary for different versions of Apache and different locations (.htaccess vs httpd.conf) for the code. It doesn’t hurt to have it and it clears away any problems with ambiguity. In your case, it ensures that any leading slash is NOT sent to example.com//file.name - i.e., it eliminates the possibility of a DOUBLE slash after the domain name.
I trust that the signature tutorial was of assistance and cleared up other points in question for you.