Jump to content


  • Posts

  • Joined

  • Last visited

Posts posted by Cole

  1. 7 hours ago, SamC said:

    You end up being redirected to www.dev.mysite.com.

    To avoid this you need to add the line:

      RewriteCond %{HTTP_HOST} !^dev\. [NC]

    So the full directive is:

      RewriteCond %{HTTP_HOST} !^dev\. [NC]
      RewriteCond %{HTTP_HOST} !^www\. [NC]
      RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    First line checks if this is NOT the subdomain 'dev'. The next line checks if it is NOT the subdomain 'www'. Finally, if both conditions are true, redirect to 'www'. So if the subdomain is 'dev' or 'www' this rule is ignored, saving you from commenting it out all the time. That is why I wanted to stop using http://localhost:8888/websites/example.com, because you have to comment that rule out for local.

    Be sure to clear your cache after adding that line to the www directive in your htaccess file. This works on all of my builds. My assumption now as to why I am getting the 403 with the builds from my team members is that they used a prepackaged version of ProcessWire for use with Foundation. I use the ProcessWire install that is provided by ProcessWire.

    If I get any new information about my 403 issue, I will reply with what I discover.

    • Like 1
  2. Thanks for the replies guys! My notifications didn't come through, my apologies for the delay.

    I had commented out all apache directives while testing this, individually, all together, my directives, ProcessWire's directives etc. The 403 seems unrelated. There are not any redirects in the template or config files. I also had added the dev URL to the HTTP Hosts Whitelist in the config file.

    Also this only happening on local and not online. I am using MAMP Pro for the local server using ports 80 and 443 with a host of dev.example.com

    Is there anything stored in the database that could affect this?

  3. Long time listener, first time caller...

    I have been working with ProcessWire for some time now and it has been amazing, my go to CMS. Previously my workflow had a local development setup through MAMP using an address like http://localhost:8888/websites/example.com.

    I have recently changed this in preference of  http://dev.example.com, that way I do not need to disable the .htaccess forward from non-www to www to develop locally. My .htaccess forward is setup like:

      RewriteCond %{HTTP_HOST} !^dev\. [NC]
      RewriteCond %{HTTP_HOST} !^www\. [NC]
      RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    This works on all sites that are still using ProcessWire 2.5, however on sites using 2.8 and 3.0 I am getting a 403 Forbidden error. After reading through the forum posts related to 403 errors I have not been successful in finding a solution for my issue. Has anyone experienced this or can assist? Thank you very much in advance, the forum community has been so helpful I have never needed to post until now.

  • Create New...