Jump to content

Access to the website with Processwire in a subfolder


Elías Gómez
 Share

Recommended Posts

4 hours ago, Francesco Bortolussi said:

In your root directory find the .htaccess file.

Inside that file check for RewriteBase

It must be uncomment something like:


RewriteBase /pw

 

I have done that, and it does not work. I have the .htaccess in the /pw folder. I think maybe the file has to be in the root of the server, and not in the root of the PW installation.

I think I am going to move the installation to the root :(

Link to comment
Share on other sites

Ok, now I understand better.
You shoud use a rewrite rule in a .htaccess of the document root, you will lost web access to your Document Root :( but your traffic will end in /pw

Something like:

RewriteRule ^(.*)$ /pw/$1

This rule should work but there are more way's to do it.

Another solution would be to create a subdomain / use a virtual host but I don't know if that is what you need.


The previous post about the RewriteBase is still valid, you still have to tell apahce that Proceswire is not in the main directory.
 

  • Like 1
Link to comment
Share on other sites

8 hours ago, Francesco Bortolussi said:

You shoud use a rewrite rule in a .htaccess of the document root, you will lost web access to your Document Root :( but your traffic will end in /pw

Something like:


RewriteRule ^(.*)$ /pw/$1

 

There are possibilities to prevent that, e.g. by excluding all physically existing files and directories using a rewrite condition:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /pw/$1

You could also add specific subdirectories from being redirected, for example if you want to have another PW installation in a sub directory named "pw3", you'd add a condition before the rule:

RewriteCond %{REQUEST_URI} !^/pw3/

 

  • Like 2
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
 Share

×
×
  • Create New...