Changing File Paths

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
6/4/2014 10:45:08 AM
Gravatar
Total Posts 28

Changing File Paths

Hi Joe,

I'm linking to numerous files throughout the site I'm working on. I'd like to change the path to these files maybe within the mojo file manager. Is there an easy way to change the references to these files throughout the site as well? So if I change the "assets" folder to "files," I'd like any hyperlinks linking to a pdf in that folder to change as well.

Please let me know if this is some thing that can be done.

Thank you!

6/4/2014 11:15:00 AM
Gravatar
Total Posts 28

Re: Changing File Paths

Also, is there a way to authenticate a pdf file within a folder to make it secure so only authenticated users can access it?

Thank you!

6/4/2014 11:46:39 AM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Changing File Paths

The only way to ensure security of files is through the Shared Files module.

6/4/2014 12:16:35 PM
Gravatar
Total Posts 18439

Re: Changing File Paths

The easiest most convenient way to share and protect files is a Jamie said using the Shared Files feature.

However, it is possible to protect static files by role via configuration. For example if you have a folder where you put pdf files and you only want users in admins role to be able to access files in that flder by url you would create a web.config file in the folder something like this:


<configuration>
<system.webServer>
<security>
<authorization>
<remove users="*" roles="" verbs="" />
<add accessType="Allow" users="" roles="Admins" />
</authorization>
</security>
</system.webServer>
</configuration>
 

now all files in the folder are limited to Admins

There is no easy way to change urls for files that may already be in content other than editing the content and fixing the url.

one other possibility is create a virtual folder in IIS named "files" and point it to the assets folder. That way either url would work so it would not break urls in existing content but going forward you could start using the new url with "files" instead of "assets"

6/4/2014 12:28:39 PM
Gravatar
Total Posts 28

Re: Changing File Paths

Thanks Joe and Jamie,

For the web.config file, what would be the proper way to reference Authenticated Users instead of Admins?

6/4/2014 12:32:32 PM
Gravatar
Total Posts 18439

Re: Changing File Paths

Just change the above example from Admins to Authenticated Users

There is actually a role named "Authenticated Users" that is assigned to all users upon registration on a site.

You must sign in to post in the forums. This thread is closed to new posts.