I've put this mod_rewrite code in my .htaccess so that it will redirect funnyall.com to www.funnyall.com, it works but the problem is when i type http://funnyall.com/2006/12/05/funny-all-1/ it will redirect to http://www.funnyall.com/index.php Is there any way to fix this problem so that when i type in http://funnyall.com/2006/12/05/funny-all-1/ it will redirect to http://www.funnyall.com/2006/12/05/funny-all-1/ Below is my code: Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} ^funnyall\.com$ [NC] RewriteRule ^(.*)$ http://www.funnyall.com/$1 [R=301,L] Code (markup): P/S: I'm using WP version 2.0.2
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} ^funnyall\.com$ [NC] RewriteRule ^(.*)$ http://www.funnyall.com/$1 [R=301,L] Code (markup): This is everything in my .htaccess
RewriteCond %{HTTP_HOST} !^www\.funnyall\.com [NC] RewriteRule ^(.*) http://www.funnyall.com/$1 [L,R=301] try that? not sure if it will work.. but try?
Try it with them switched around, with the redirect first. Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} ^funnyall\.com$ [NC] RewriteRule ^(.*)$ http://www.funnyall.com/$1 [R=301,L] # BEGIN WordPress <IfModule mod_rewrite.c> RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
OH MY LORD it works!!! Thank you so so much Nintendo! You have no idea how happy i am now. By the way is it ok to put the redirection code on top of the wordpress code? Another thing is what is this code? It appears in all my .htaccess when i create a website account. Can i remove it? # -FrontPage- IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti* <Limit GET POST> order deny,allow deny from all allow from all </Limit> <Limit PUT DELETE> order deny,allow deny from all </Limit> AuthName www.funnyall.com AuthUserFile /home/funnyall/public_html/_vti_pvt/service.pwd AuthGroupFile /home/funnyall/public_html/_vti_pvt/service.grp Code (markup):
It works, there for it's OK! Ack...that code is FrontPage!!! If you don't use FrontPage, you can probably dump it.