Jump to content

processwire install on a sub-directory

Recommended Posts


You should uncomment this line in .htaccess and change "pw" to the name of your folder

 RewriteBase /pw/

Also, there is a branch of similar topics: 


  • Like 2

Share this post

Link to post
Share on other sites

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

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...