Search…

X3 Photo Gallery Support Forums

Search…
 
FrederikFuchs
Topic Author
Posts: 13
Joined: 11 Jun 2013, 09:41

redirect

22 Nov 2014, 16:19

following feature would be great:

when moving a folder to another place (in imagevue-panel), the old link will -of course- not be available anymore (404 page not found).
The current solution to avoid that i.e. facebook-share of old-location remains available would be to add an additional folder (matching the FB-link) and link the gallery-assets to the new location.

it would be great if a kind of redirect-feature could be implemented. giving the correct response in terms of SEO for removed links (301 ?) and link to new location.

I know this will not be ready and aviailable with 1st priority, but maybe it can be put on the todo list for later releases.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13997
Joined: 30 Sep 2006, 03:37

Re: redirect

22 Nov 2014, 23:57

Interesting concept ... The difficult part is that then the folder would need to be kept in your content structure and also available to you from the panel. I would assume that could easily cause confusion? We could perhaps add a setting "redirect" that redirects to another pages, but it would still mean you basically need to keep copies of all your locations ...

The correct- and easiest way to handle this, is to simply add a link at the bottom of your .htaccess file, and no need to keep ghosts for moved folders:
Code
# RedirectMatch 301 oldpath(.*) /new/path/here$1
 
FrederikFuchs
Topic Author
Posts: 13
Joined: 11 Jun 2013, 09:41

Re: redirect

25 Nov 2014, 13:10

yep, you are right. Even though .htaccess might affect Apache-performance (because it is triggered for every single request), this redirect-line is probably the cleanest solution.
But manually editing .htaccess is crap because this requires to ftp into the web-server each time after a folder-location is changed.
Ok, obviously changing folders will not happen that much (on production-sites), but it could be worth implementing a script that automatically asks if user wants to add a line to .htaccess after a folder is moved.
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13997
Joined: 30 Sep 2006, 03:37

Re: redirect

26 Nov 2014, 04:42

We might consider adding a htaccess-editor, but it would probably just be similar to settings where it loads the file and can be edited. It would be out of scope, and prone to errors to create a system that injects and replaces rules in the htaccess file.

Of course the fewer rules in htaccess the better, but htaccess is quite performant and is loaded into server memory. That is why htaccess is the recommended way for servers to add rewrite rules, compression and redirects more so than PHP. Keep in mind, Imagevue X3 is basically a PHP application at index.php where all requests get routed through. If you keep a ghost folder for redirect, the request would still route through the PHP, which would need to process the redirect, then render another page ... All requests will basically be processed by the PHP, but htaccess is much more efficient for intercepting a redirect before the PHP even processes it.