Elías Gómez Posted December 15, 2016 Posted December 15, 2016 I am creating a site with Processwire in the subfolder /pw. If I want to access the website at http://mydomain.com/ insted of at http://mydomain.com/pw/ withoud moving the instalation to the root folder, ¿what should I do? ¿Is it possible? I want to have my FTP folders organized Thanks!
dotnetic Posted December 15, 2016 Posted December 15, 2016 You can do that with a .htacces and mod_rewrite. Don´t know exactly what you have to write, but google for "htaccess subfolder as root". Maybe here is a solution: http://stackoverflow.com/questions/990392/htaccess-rewrite-to-redirect-root-url-to-subdirectory
Doug G Posted December 16, 2016 Posted December 16, 2016 It seems to me I just had to set the rewrite_base in the distributed processwire .htaccess 1
Francesco Bortolussi Posted December 16, 2016 Posted December 16, 2016 In your root directory find the .htaccess file. Inside that file check for RewriteBase It must be uncomment something like: RewriteBase /pw 1
Elías Gómez Posted December 16, 2016 Author Posted December 16, 2016 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
Francesco Bortolussi Posted December 19, 2016 Posted December 19, 2016 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. 1
BitPoet Posted December 19, 2016 Posted December 19, 2016 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/ 2
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