Whenever I enable this rewrite rule in my .htaccess file the redirect works, but then forms on my site don't work.
Code: Select all
#RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
#RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]
Here a sample of my complete .htaccess file. Any help/suggestions to make this better is much appreciated.
Code: Select all
#php_flag magic_quotes_gpc Off
#php_flag register_globals Off
#php_flag session.use_trans_sid Off
#php_value upload_max_filesize 16M
#php_value memory_limit 16M
# Make sure you have Options FollowSymLinks
# and Allow on
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
#Rewrites page.shtml as index.php?page
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
#AuthType Basic
#AuthName "Password Required"
#AuthUserFile /aomam.org/httpdocs/auth/.passwd
#AuthGroupFile /aomam.org/httpdocs/auth/group.file
#require valid-user
#Require Group admins
#RewriteEngine on
#RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
#RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]