Ok, you can call me a noob, and I could possibly get flamed, but I can't figure this one out for the life of me. I don't know why mod_rewrite gives me so much trouble.
Ok, so here's what I'm trying to do. I want to remove the "www" from the URL, but only on a subdomain.
I have this rule, which removes it from the whole domain:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.mydomain.com$ [NC]
RewriteRule ^(.*)$ http://mydomain.com/$1 [R=301,L]
and that works ok. But in this instance, I only want to remove it from one directory and it's sub directories.
For example:
I want www.mydomain.com/catalog to be rewritten to http://mydomain.com/catalog
If anyone could help I would be greatly appreciative. I've spent like 3 hours trying everything I could to get this to work with no luck.
Ok, so here's what I'm trying to do. I want to remove the "www" from the URL, but only on a subdomain.
I have this rule, which removes it from the whole domain:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.mydomain.com$ [NC]
RewriteRule ^(.*)$ http://mydomain.com/$1 [R=301,L]
and that works ok. But in this instance, I only want to remove it from one directory and it's sub directories.
For example:
I want www.mydomain.com/catalog to be rewritten to http://mydomain.com/catalog
If anyone could help I would be greatly appreciative. I've spent like 3 hours trying everything I could to get this to work with no luck.