very long time lurker of SO however i finally got something I can not patch together from good examples here. I have got a good concept of how regex works but I'm not sure enough concerning the syntax of htaccess to complete things i need. To a front controller style site(i.e. single access point). Here's what I am searching for:

Base URL Structure

  1. ->
  2. ->
  3. world wide ->
  4. ->

These may also be utilized via in addition to's a real road to the addon domain folder instead of finding yourself in root). I have to make certain these two versions also redirect to

Files &lifier Sites, Extensions &lifier Trailing Slash

  1. URL/index.php ->
  2. URL/file.php -> (numberperl extensions(.css/.js are fine), no trailing slash)
  3. URL/directory/file.php -> (might be multiple directory levels but needs same rules as #2)

This really is my current .htaccess which does the spinning properly (I'm able to access the above mentioned URL structures and all sorts of use index.php because the access point) however the structure is not enforced - can access all versions from the structure above. And So I assume it's actual redirecting I have to do instead of further spinning.

<IfModule mod_rewrite.c>
RewriteEngine on
# Do not rewrite AJAX requests
RewriteRule ^(ajax.php) - [L]

# Do not rewrite specific extensions
RewriteCond %{REQUEST_URI} !\.(css|gif|ico|jpg|js|png|swf|txt)$

# Do NOT rewrite existing files
RewriteCond %{REQUEST_FILENAME} !-f

# Do NOT rewrite existing directories.
RewriteCond %{REQUEST_FILENAME} !-d

# Pray it works
RewriteRule ^(.*)$ index.php?url=$1 [PT,L,QSA]

This presently enables me to make use of $_GET['url'] on my small index.php access point to fetch content. It's getting everything after for example directory/file?parameter=values&etc=example

Also, what's the distinction between: redirect 301 "/old.htm" and taking advantage of a RewriteRule having a [R=301] tag? I believe the only real difference is you would employ a RewriteRule should you required to conditionally redirect/rewrite multiple URL's instead of one static Hyperlink to another static URL correct? I am asking since the only upkeep I'll desire to make does 301's whenever a file will get gone to live in another location.

I have attempted a couple of different approaches however i usually finish up smashing the rewrite when attempting to perform a redirect or I finish track of about 5 conditions per redirect for any very lengthy file. I actually do this with PHP alot by writing multiple nested if/elses when typically only one or two is required. And So I guess I am asking if each example above requires multiple conditions along with a redirect rule or can multiple conditions be condensed into one line for those good examples then just one redirect?

Thank you ahead of time for schoolin me!