Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
alexhenes
Experienced
Topic Author
Posts: 568
Joined: 28 Sep 2006, 16:13

301 Redirects: X2 to X3

12 Dec 2014, 18:46

I am trying to write 301 redirects from X2 URLs to X3 URLs and running into some problems.

Here is an example of an X2 URL

http://www.merelyafleshwound.com/#/moun ... an%20peak/

The problem is that the # and everything after isn't sent to the server. It's normally used by the browser to find a specific point in a web page and scroll you to it.

For instance, if you have a html page index.html and one of the tags has an id=abc, then when you request index.html#abc, the browser gets index.html, then looks for an element with the abc id, then scrolls you to it. The #abc is never sent to the server.

I think this is how the X2 is doing deep linking but this is all done in their javascript. There's no way for me to capture the # and take action on the server side.

Any thoughts on X2 to X3 301 redirects?
Alex
https://www.merelyafleshwound.com
https://www.goldenbikeshop.com
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13998
Joined: 30 Sep 2006, 03:37

Re: 301 Redirects: X2 to X3

13 Dec 2014, 05:44

Unfortunately this may be complicated as hashtags are not really part of the URL and are not processed by htaccess. I found this post that links to another website, which may have some suggestions, which my be very tedious to integrate:
http://stackoverflow.com/questions/8185 ... ccess-file

On the brighter side, we just launched X3 Beta V0.7, with support for link- and redirects:
https://www.photo.gallery/x3docs/pages/link/
 
User avatar
alexhenes
Experienced
Topic Author
Posts: 568
Joined: 28 Sep 2006, 16:13

Re: 301 Redirects: X2 to X3

16 Dec 2014, 01:24

I like the redirects feature... however... with roughly 220 X2 gallery URLs it would be quite the task to create a redirect page for each of them. Any other ideas on how to map old X2 URLs to new X3 URLs?
Alex
https://www.merelyafleshwound.com
https://www.goldenbikeshop.com
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13998
Joined: 30 Sep 2006, 03:37

Re: 301 Redirects: X2 to X3

16 Dec 2014, 11:43

Since X2 is essentially a single-page application, and the #hashtag is basically just a reference that gets forwarded to the X2 flash application, the only solution would be javascript. It would require a custom javascript that check the hashtag of the incoming URL, and then checks it against a redirect match list, similarly added as the javascript you have for banners ... Thus, you would still need to manually manage the redirects, although you would be able to do so from a single-page configuration.

We could build it entirely dynamically, but that would require that your new URLs can be matched by pattern to previous URLs. Eg. they would need to be identical /#/PATH == /PATH
 
User avatar
alexhenes
Experienced
Topic Author
Posts: 568
Joined: 28 Sep 2006, 16:13

Re: 301 Redirects: X2 to X3

16 Dec 2014, 13:13

I don't have identical paths between X2 and X3... but I do have a spreadsheet that maps old to new
Alex
https://www.merelyafleshwound.com
https://www.goldenbikeshop.com
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13998
Joined: 30 Sep 2006, 03:37

Re: 301 Redirects: X2 to X3

16 Dec 2014, 13:26

alexhenes wrote:I don't have identical paths between X2 and X3... but I do have a spreadsheet that maps old to new
We could create a JS similar to the one you have for banners then, that redirects paths based on a config ... You would have to fill the config object manually though:
Code
'#/old/path/' : '/new/path/',
'#/another/old/path/' : '/some/new/path/'
... and so on ...
I can't do anything with your spreadsheet ... You would have to do some copy-pasting ...
 
User avatar
alexhenes
Experienced
Topic Author
Posts: 568
Joined: 28 Sep 2006, 16:13

Re: 301 Redirects: X2 to X3

19 Dec 2014, 11:25

I will work on this... is the format below that exact format I should build?
Alex
https://www.merelyafleshwound.com
https://www.goldenbikeshop.com
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13998
Joined: 30 Sep 2006, 03:37

Re: 301 Redirects: X2 to X3

20 Dec 2014, 12:51

alexhenes wrote:I will work on this... is the format below that exact format I should build?
yea, but it would require me to create a rather comprehensive javascript function first to handle it ...