haha Posted February 10, 2017 Share Posted February 10, 2017 i need install pw to a sub-directory, how i modify .htaccess? Link to comment Share on other sites More sharing options...
Zeka Posted February 10, 2017 Share Posted February 10, 2017 Hi. 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: 2 Link to comment Share on other sites More sharing options...
szabesz Posted February 10, 2017 Share Posted February 10, 2017 (edited) 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 February 10, 2017 by szabesz typo 4 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now