Jump to content
joebaich

.htaccess file in PW Distribution

Recommended Posts

This part of the htaccess file in the current (and previous) PW distributions also rewrites, for me anyway, anything.mydomain.com as www.anything.mydomain.com

  # -----------------------------------------------------------------------------------------------
  # OPTIONAL: Redirect users to the 'www.' version of the site (uncomment to enable).
  # For example: http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Share this post


Link to post
Share on other sites

It's disabled by default anyway - it is doing what it's supposed to do. Only enable it if you want it. :-)

Share this post


Link to post
Share on other sites

With respect, it may be doing what it's meant to do but it's also doing what it's not meant to do - by that I mean according to a literal interpretation of the preceding comments in that section of the file.

Certainly http://mydomain.com/ would be redirected to http://www.mydomain.com. I wanted it to do that. What I didn't want it to do is redirect http://cdn.mydomain.com to http://www.cdn.mydomain.com which it did too. It took me hours to work out that this was what was causing my first ProCache CDN integration to fall over. Like most problems, easy enough to fix once one has identified it but a pain in the rear until then.  Only a word or two more about the impact on sub domains would help and explaining that one can exclude them from the rewrite by adding them to the condition e.g. RewriteCond %{HTTP_HOST} !^(www|sub1|sub2)\.[NC]

  • Like 2

Share this post


Link to post
Share on other sites

@joebaich - i've been (slightly) stung by this also at some point; your fix is appreciated - i often need to redirect the main site to www, but at the same time have a subdomain like dev but don't want that www prepended..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...