Jump to content

processwire install on a sub-directory


Recommended Posts

Well, that depends... If you have a domain for the site or create a subdomain for the site, then we are talking about two different situations. For example in the case of a standard cPanel only account: say you have dev.example.com and want to install ProcessWire in /public_html/dev_example, in that case the default .htaccess file just does its job fine. However, when I moved the "main" site – which runs under the domain the cPanel account is tied to – to a subdirectory, only these rules did the trick for me:

  RewriteCond %{HTTP_HOST} ^(www.)?szabesz\.hu$ 
  RewriteCond %{THE_REQUEST} \s/+szabesz_hu/(\S*)\s [NC]
  RewriteRule ^ /%1 [R=302,L,NE]

Where szabesz.hu is my site, szabesz_hu is the subdirectory. I inserted this before  the line RewriteCond %{REQUEST_FILENAME} !-f

Also $config->urls->root = '/'; must probably be present in /site/config.php to get page()->url return the url segments without the subfolder being part of it, more on this: https://processwire.com/api/ref/page/url/

Nothing else I found in the forum or in the docs worked in my case. And there are other situations as well, but I just wanted to point out this one, since I had to google around to solve it.

Your scenario can be different though, so you might want to provide some information about what you exactly want to solve .

Edited by szabesz
  • Like 4
Link to comment
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...