Jump to content

aren
 Share

Recommended Posts

Hi guys, I have a few questions regarding a few common practices when dealing with CMSes:

1- How can I install ProcessWire above the root for better security?

2- How can I change the default folder for uploading images? For example, I'd like to create a folder /uploads in the root and have all my uploaded images in there. And can I have multiple folders or just one folder for all images?

3- Is it possible to have site assets (css, js etc) stored in a folder /assets in the root?

If you have other common practices or security tips etc and you'd like to share, please do. ;)

Link to comment
Share on other sites

Regarding moving assets (as in static site files, JS and images etc.) outside /site/:

Keeping everything "site-specific" within /site/ can make upgrading ProcessWire slightly easier and enables you to move all site-specific files to another server / PW installation etc. without needing to wonder which files were / are part of PW and which belong to this specific site.

This is also how (and why) modules such as Site Profile Exporter work; they simply copy (most) content of /site/ folder and leave everything else intact.

So, short answer is "yes, you can do it." But that doesn't necessarily mean that you should do it :)

  • Like 4
Link to comment
Share on other sites

1- How can I install ProcessWire above the root for better security?

You can move your /wire/ dir wherever you want and use symlinks. However, I don't think this would do anything for security. The benefit of doing it would be just if you want to share the same /wire/ dir amont multiple installs. I think that some CMS products are prone to vulnerable files and so you want to move them out of web root. ProcessWire is not one of those products and your .htaccess file protects several directories from web access. 

2- How can I change the default folder for uploading images? For example, I'd like to create a folder /uploads in the root and have all my uploaded images in there. And can I have multiple folders or just one folder for all images?

You can try modifying PW's /index.php file to choose a different $config->assets dir. But I don't recommend it, as I've not tested it. 

3- Is it possible to have site assets (css, js etc) stored in a folder /assets in the root?

Yes, you can store these assets wherever you want. ProcessWire doesn't actually link to them, only you do, in your template files. As a result, it doesn't matter where you put them. 

  • Like 2
Link to comment
Share on other sites

  • 6 months later...

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...