Root level htacess and redirects issues
Posted: Sun Mar 29, 2009 8:31 pm
I'm having an issue with redirects and htaccess. I'm trying to redirect any traffic arriving to mydomain.com to go to www.mydomain.com instead. The following is the code I'm using for that purpose in the root level htaccess file (I've changed my own domain name into "mydomain" below to avoid getting this crawled by Google and indexed as a weird link as it did before):
However that causes a problem: if I navigate to www.mydomain.com/s9y/ (let's say that's my path to the Serendipity installation), everything works fine. However if I try to go to www.mydomain.com/s9y (without the trailing slash), the URL gets re-written as http://www.mydomain.com/cgi-bin/php5-cgi/s9y/index.php and that obviously doesn't work well.
I'm using mod_rewrite in Serendipity's settings because errorhandling, which I'm not too familiar with, was working and fixing that problem but also returning a "File does not exist" which I assume were 404's in the server's error log with every page load, even though the blog was loading fine in my browser.
As it is, my Serendipity htaccess file is unchanged from what is created by turning mod_rewrite on.
Just in case, here's my real s9y install: http://www.vincentmounier.com/blog2/ ; I have turned root level redirects off for now to avoid the conflict with Serendipity. That way I am having partial success: navigating to www.mydomain.com/s9y redirects me to mydomain.com/s9y/, which works but really isn't what I want...
I must be missing something obvious. How can I set Serendipity's htaccess to co-exist with my root-level redirects?
Cheers,
Vince
Code: Select all
Options +FollowSymlinks
RewriteEngine On
RewriteOptions MaxRedirects=10
RewriteCond %{HTTP_HOST} ^mydomain.com$ [NC]
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L]
I'm using mod_rewrite in Serendipity's settings because errorhandling, which I'm not too familiar with, was working and fixing that problem but also returning a "File does not exist" which I assume were 404's in the server's error log with every page load, even though the blog was loading fine in my browser.
As it is, my Serendipity htaccess file is unchanged from what is created by turning mod_rewrite on.
Just in case, here's my real s9y install: http://www.vincentmounier.com/blog2/ ; I have turned root level redirects off for now to avoid the conflict with Serendipity. That way I am having partial success: navigating to www.mydomain.com/s9y redirects me to mydomain.com/s9y/, which works but really isn't what I want...
I must be missing something obvious. How can I set Serendipity's htaccess to co-exist with my root-level redirects?
Cheers,
Vince