XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).
Moderator: General Moderators
JAB Creations
DevNet Resident
Posts: 2341 Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:
Post
by JAB Creations » Fri Feb 06, 2009 12:28 am
This seems to work!
Code: Select all
<ifmodule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ blog/index.php?q=$1 [L]
</ifmodule>
...and to access the query try the following...
Code: Select all
echo '<div>'.$_SERVER['argv'][0].'</div>';
JAB Creations
DevNet Resident
Posts: 2341 Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:
Post
by JAB Creations » Sat Feb 07, 2009 2:38 am
I saw a video (thanks for the link Josh) and tried out some code...it's minimal and allows exceptions for file extensions so I thought this would be a helpful revision of the code I've posted...
Code: Select all
<ifmodule mod_rewrite.c>
RewriteEngine on
RewriteRule !\.(css|gif|jpg|js|png)$ page.php
</ifmodule>
*EDIT* Removed "?q=$1" from the end of line 3. Archive readers may want to change page.php to index.php after they become comfortable with this.