Reputation:
I'm at a loss for what to do here. Basically the situation is I have a non technical client that uses a Joomla content uploader to upload pdf's to his website. Since he has little knowledge on these matters I can't change the way he uploads pdfs. However when he uploads these files they are accessed at http://www.website.com/images/stories/mktinsights/somepdf.pdf
but when he clicks these links in his article he gets http://www.website.com/resources/images/stories/mktinsights/somepdf.pdf
My question is, is there a way in the .htaccess to remove the /resources/ without breaking the other links that use this structure.
Hopefully my question makes sense. Thanks.
Upvotes: 1
Views: 207
Reputation: 1825
First question really is why does this happen? When he creates the link to the pdf files and you view the source (within the editor before saving the content) is 'resources' part of the path? If not then some kind of redirect or url rewrite is taking place and needs to be tracked down and removed. If 'resources' does form part of the path then you need to find out why. This is most definitely NOT default Joomla behaviour and is either being caused by an add-on, or perhaps by a setting. It might be an idea to check in global configuration to see if anything is visible that contains 'resources'.
If he is using a non-standard WYSIWYG editor it might be worth switching (temporarily) to the default editor to see if the behaviour changes. If he is using some sort of third party 'linker' plugin (usually a button beneath the WYSIWYG editor) try inserting a link manually, or using some other mechanism (specifics will depend on editor in use).
If all else fails - and ONLY if all else fails - the following line added to the .htaccess file should work. Add it after the RewriteBase line - but before the rest of Joomla's rewriterules:
RewriteRule resources/(.*)$ $1 [L]
I've noticed that some servers seem to require a slash before resources, and others not. If it doesn't work without, then add it.
Oh, and if you don't have a file named .htaccess in the root of the site you either need to tell your FTP client to show 'dot' files or 'hidden' files, or if no one has done so already rename the htaccess.txt file to .htaccess (starts with a dot and has no other file suffix).
Upvotes: 1
Reputation: 1738
The easiest way to fix this would be with a symlink.
Alternatively, if you have access you can use an apache Alias declaration:
Alias /mktinsights /resources/images/stories/mktinsights
Upvotes: 1