I looked at this topic: http://stackoverflow.com/questions/3317580/configuring-search-engine-friendly-url-mod-rewrite and understand how the rewrite rules would apply, but need help understanding how to adopt them for websites that have static and dynamic URL's.
From the topic above, the rewrite rules would first look for a file that existed in the URL, and deliver it. So that would cover my static pages.
Question 1: would indexing be preserved (in other words, domain.com/foo would show domain.com/foo/index.php)?
Question 2: is there a way to use a single template file with these static pages (so the static file is really only the content)? At the moment, my rewrite rules point all URL's to a main template file that looks for the requested file and then includes it.
Moving on, the rewrite rules would redirect you to index.php for any URL's that didn't match the above rule. I assume that's where I'd want my code to determine if it's an actual URL for my site, and deliver the content accordingly.
Question 3: redirecting to index.php isn't going to pass along any variables to process. If I used index.php?url=$1 would that account for both domain.com/hi and domain.com/hi/there?
Question 4: what steps can I take to ensure the URL's processed are legitimate (and not xss attacks or anything like that)? Should I set up a separate table in my MySQL database that stores all the possible URL's along with the ID of the content? I assume that's how Wordpress works. Or, if not using MySQL, would I do this with a class, or array?
I know it's a lot, thanks in advance for everyone's help!