Forum Moderators: phranque
I have added a code to my httpd.conf but it aint workin!
This is what I got.
<Directory />
Options FollowSymLinks
AllowOverride None
RewriteEngine On
# Check to see if requested page exists
RewriteCond %{REQUEST_fileNAME}!-s
RewriteCond %{request_filename}!-d
RewriteCond %{request_filename}/!-d
# Redirect non-www to www
# RewriteCond %{HTTP_HOST}!^mysite\.com [NC]
# RewriteRule (.*)http://www.mysite.com/$1 [R=301,L]
Do you have any ideas of why its not working?
# For use in httpd.conf or conf.d
Options +FollowSymLinks
AllowOverride none
RewriteEngine on
#
# Redirect all non-canonical domains to canonical www domain
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteRule ^/(.*) http://www.example.com/$1 [R=301,L]
#
# Check to see if requested page exists as a file or directory. If not, rewrite to script
RewriteCond %{REQUEST_FILENAME} !-s
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}/ !-d
RewriteRule ^/(.*) /some_script.php?requested_page=$1 [L]
#
Jim