All the pages on my website (except the messageboard) are displayed like this: /?page=xxxx But I want to use mod_rewrite so that it hides the ?page= and uses everything after that to create /xxxx/. So http://mywebsite.com/?page=contact would load up by going to http://www.mywebsite.com/contact/ Remember I don't want it to effect http://www.mywebsite/messageboard/ Can this be done?
Yes. Their is a mod_rewrite forum on here...or maybe its Apache. Either way, go to that forum and post it there. They'll be able to help. Also, doing a couple of quick searches in Google and you'll find what you're looking for. Search under: .htaccess mod rewrite
This is easy. 1. Look for .htaccess in your root directory. If it is not there, create it. 2. Look for: RewriteEngine ON in the beginning. If it is not there, type it as the first line. 3. Type: RewriteRule ^page-(.*)$ index.php?page=$1 [L] 4. Try this: www.mysite.com/page-contact If it works fine, you will need to change all links on the site to /page-(page_here)
(First two lines might not be needed.) Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^([^.]+)/$ index.php?page=$1 [L] This is if the index file is index.php and make sure you have no real directories, or they'll be messed up, hince the page- suggestion he gave you! er...after you try it, go to domain.com/messageboard/ and you'll see why you need the page- part. You need something unique in the URL. .html would work.
I do have real directories so I guess doing what I really want (no manual adding to htaccess per page) isn't possible. I'll have to stick with this: RewriteEngine on RewriteRule ^(profile|biography|schedule|quotes|career|results|images)(/)?$ /?page=$1 Thanks everyone anyway....