combining two different htaccess methods into one
- by Patrick
Im having trouble getting this htaccess to work properly.
This is my file as it stands
RewriteEngine on
RewriteBase /
RewriteRule ^sam/$ animals.php [QSA]
RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)|(\.swf)|(\.xpi)|(\.ico)|(\.src)$
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteRule (.*)$ get.php?code=$1 [L]
When i use
RewriteEngine on
RewriteBase /
RewriteRule ^sam/$ animals.php [QSA]
or
RewriteEngine on
RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)|(\.swf)|(\.xpi)|(\.ico)|(\.src)$
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteRule (.*)$ get.php?code=$1 [L]
independently, it works fine, but together neither work properly.
Here is what im trying to do:
Any requests sent to domain.com/sam/?whatever=dogs, will get sent to domain.com/animals.php?whatever=dogs
Any requests sent as domain.com/whatever, will get sent to domain.com/get.php?code=whatever