htaccess to redirect single folder to another url folder

This forum is for general questions about extensions for Joomla! 3.x.

Moderators: pe7er, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
conanthedestroya
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Wed May 16, 2007 8:01 pm

htaccess to redirect single folder to another url folder

Postby conanthedestroya » Sat Jul 15, 2017 2:20 am

Hi,

I've got a Joomla gallery that looks to that folder for the images. I can't change the galleries root path to another url and has to be inside the current Joomla directory.

Using the htaccess file Is it possible to redirect any request that goes to that folder on to a folder on another url, in particular inside a bucket up on Amazon S3?

The folder would be 'mywebsite.com/media/hdimages'

As there will be so many of them it won't take too long to use up the 250,000 inode cap on the hosting account as that cap also includes Joomla files, emails etc.

I can't use Ja Amazon S3 component as it has no effect so thought the htaccess file route redirect work.

Worth a try asking and many thanks,

Andrew

User avatar
leolam
Joomla! Master
Joomla! Master
Posts: 17802
Joined: Mon Aug 29, 2005 10:17 am
Location: Netherlands/ UK/ S'pore/Jakarta/ North America
Contact:

Re: htaccess to redirect single folder to another url folder

Postby leolam » Sat Jul 15, 2017 4:24 am

If your hosting account uses cPanel you can use a cPanel re-direct to achieve tis in seconds. See a good explanation here https://www.[youtube].com/watch?v=AyQikvf40FM (remove the [])

Leo 8)
- Joomla Professional Support Services :https://gws-desk.com -
- Joomla Specialized Hosting Solutions:https://gws-host.com -
- Joomla Professional Web Development :www.gws-studio.com -
- Member Joomla Bug Squad & J-CMS Release Team

conanthedestroya
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Wed May 16, 2007 8:01 pm

Re: htaccess to redirect single folder to another url folder

Postby conanthedestroya » Sat Jul 15, 2017 5:07 am

Hi Leolam,

Thanks for your quick reply.

I watched the video then setup up the redirect in CPanel. The redirect works fine if someone was actually going to mywebsite.com/media/hdimages but it's not really something the public would access directly. It's only the Joomla gallery component that looks to that folder for the images as it's the root path set in the component options.

To test I deleted the images from the original hdimages folder so that the redirect above would hopefully take over but instead I get the following error message when I load a joomla page that should have a small gallery in it:

Warning

JFolder: :files: Path is not a folder. Path: /home/username/mywebsite.com/media/hdimages


I guess the gallery component is still looking only in the media/hdimages folder and not being tricked and redirected to Amazon S3 :-(


Andrew

User avatar
leolam
Joomla! Master
Joomla! Master
Posts: 17802
Joined: Mon Aug 29, 2005 10:17 am
Location: Netherlands/ UK/ S'pore/Jakarta/ North America
Contact:

Re: htaccess to redirect single folder to another url folder

Postby leolam » Sat Jul 15, 2017 5:12 am

This can be modified in code but requires experienced coders to complete. I believe that this is not possible as you now describe with any redirect since the code does not support that (searches for a Joomla path). Somebody needs to look into the extension and create that for you probably with a "hidden" component or plugin

Leo 8)
- Joomla Professional Support Services :https://gws-desk.com -
- Joomla Specialized Hosting Solutions:https://gws-host.com -
- Joomla Professional Web Development :www.gws-studio.com -
- Member Joomla Bug Squad & J-CMS Release Team

conanthedestroya
Joomla! Apprentice
Joomla! Apprentice
Posts: 19
Joined: Wed May 16, 2007 8:01 pm

Re: htaccess to redirect single folder to another url folder

Postby conanthedestroya » Sat Jul 15, 2017 10:46 pm

Thanks Leo. I thought it was worth asking just in case the htaccess idea may have been a quick fix.

I've already got in touch with the developer of the gallery component but it's pretty slow going and looks like they have to make some serious modifications which I guess will make future updates difficult.

I'm now thinking it may be easier all round just to shift the website over to an Amazon EC2 instance as there's no restrictions as with smaller hosting companies. Shame not to support the smaller guys like I normally do but this website needs a bit more than normal.


Andrew


Return to “Extensions for Joomla! 3.x”

Who is online

Users browsing this forum: No registered users and 13 guests