Forum Moderators: phranque
current code:
Options +FollowSymlinks
RewriteEngine On
#
RewriteCond %{HTTP_HOST} ^example.com$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
[edited by: jdMorgan at 10:19 pm (utc) on Sep. 10, 2009]
[edit reason] example.com [/edit]
If you mean that pages in subdirectories below the directory in which this code resides are not being redirected, and if there *is not* another .htaccess file in that subdirectory, then you might try adding a directive to your code (and cleaning up a few other items as well).
Options +FollowSymlinks
RewriteOptions inherit
RewriteEngine on
#
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
Options +FollowSymlinks
RewriteOptions inherit
RewriteEngine on
#
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
Jim
Options +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# RewriteCond %{HTTP_HOST} !^www\.examplesite\.com$ [NC]
# RewriteRule ^(.*)$ [examplesite.com...]
%{REQUEST_URI} [L,R=301]
RewriteRule .* index.php/$0 [PT,L]
</IfModule>
Options +FollowSymlinks
RewriteOptions inherit
RewriteEngine on
#
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
same issue as before...urls for sub folders without the www do not automatically redirect to the www version...any other thoughts?
Do the sub-folders (and the requested objects in them) physically exist?
Do you have MultiViews enabled? Does your site require them (i.e. does it use content-negotiation)?
Are there any rules in other .htaccess files in directories above or below this one? Or in the server config files?
(Basically, something is interfering with the rule, which is perfectly-fine -- unlike that invalid/mis-coded mess you found elsewhere).
Jim