Forum Moderators: phranque
Options +FollowSymLinks
RewriteEngine on
# if not the correct domain
RewriteCond %{HTTP_HOST} ^(www\.)?example\.ca [NC]
# redirect to correct domain
RewriteRule (.*) http://example.com/$1 [R=301,L]
after adding this to the .htaccess, example.ca does not redirect to example.com. Not sure what I did wrong. Here is a copy of my .htaccess file.
Thanks.
# -FrontPage-
IndexIgnore .htaccess */.?* *~ *# */HEADER* */README* */_vti*
SetEnvIf Request_URI "^(/403.*\.htm?:/robots\.txt)$" allowit
# Block bad-bots using lines written by bad_bot.pl script above
# Ban .htaccess & .htpasswd requests
SetEnvIfNoCase Request_URI \.ht(access¦passwd)$ ban
<Files *>
Order deny,allow
Deny from env=ban
Deny from env=getout
Allow from env=allowit
</Files>
Options +FollowSymLinks
RewriteEngine on
# if not the correct domain
RewriteCond %{HTTP_HOST} ^(www\.)?example\.ca [NC]
# redirect to correct domain
RewriteRule (.*) http://example.com/$1 [R=301,L]
RewriteEngine on
RewriteRule ^/?http:// - [F]
Options +FollowSymLinks
RewriteEngine on
RewriteRule (mail.?form¦form¦form.?mail¦mail¦mailto¦sendmail)\.(cgi¦exe¦pl¦asp¦php¦pm)$ /cgi-bin/trap.pl [NC,L]
<snip>
[edited by: jdMorgan at 9:39 pm (utc) on May 27, 2006]
[edit reason] Code dump, example.com [/edit]
The following will prevent your annoyances code from working properly; The last RewriteCond before a RewriteRule must never have an [OR] flag.
# Covenant Eyes
RewriteCond %{REMOTE_ADDR} ^69\.41\.14\.([1-9]?[0-9]¦1[01][0-9]¦12[0-7])$ [OR]
RewriteRule - [F]
Jim