Forum Moderators: phranque
DefaultType application/x-httpd-php
AddHandler x-httpd-php .php4
#
Options +FollowSymLinks
RewriteEngine on
#
# Externally redirect direct client requests for "/index.php" or
# "/index.php4" in any subdirectory to "/" in that same directory
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/\ ]+/)*index\.php4?\ HTTP/ [NC]
RewriteRule ^(([^/]+/)*)index\.php4?$ http://newsite.com/$1 [R=301,L]
#
# Externally redirect all requests for non-blank non-canonical hostnames to canonical hostname
RewriteCond %{HTTP_HOST} !^(newsite\.com)?$
RewriteRule ^(.*)$ http://newsite.com/$1 [R=301,L]
#
# Internally rewrite "/ama/<id>" URL requests to amazon script filepath, passing <id> value in query string
RewriteRule ^ama/([A-Za-z0-9]+)$ /includes/amazon.php?id=$1