I know this is not a php question, but I don't know of a good forum to post this question on and I've gotten a lot of good advice here in the past.
I have a .htaccess file. Its located in the /blog/ directory of my website.
Located in this directory is an wordpress installation.
My ht access file looks like this:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mywebsite\.com$ [NC]
RewriteRule ^(.*)$ http://www.mywebsite.com/blog/$1 [R=301,L]
RewriteBase /blog/
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress
What I am trying to do is redirect all of the traffic that does not have www to the www address.
The .htaccess file works great except for one instance. If you go to
"mywebsite.com/blog"
with no www and no trailing / the sites does not just add the www. It adds the www but make the whole url "www.mywebsite.com//path/to/site/directory/on/server/"
The "/path/to/site/directory/on/server/" Is the location of the site on the server.
Any idea why it would do this is not redirect that one url properly.
Again, I know this is mainly a php forum but if anyone has any idea they would be greatly appreciated.