Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace (proxy) at all body links #22

Open
faustoct1 opened this issue Feb 13, 2016 · 4 comments
Open

Replace (proxy) at all body links #22

faustoct1 opened this issue Feb 13, 2016 · 4 comments

Comments

@faustoct1
Copy link

first of all thanks for your gem.

when i use the gem at mydomain.com/blog if proxies perfect pointing to my mydomain.wordpress.com blog. The problem is when I click any link it redirect to my mydomain.wordpress.com/link . I'd like to keep it under same domain for every click for SEO purposes.

@waterlink
Copy link
Owner

The library works correctly. It does not do anything to the payload, that is transferred. There are 2 possible solutions:

  • Try to make all urls relative instead of absolute on the original website, i.e.: instead of http://example.com/the/url/path/here it should just have /the/url/path/here. Or
  • Add additional Rack middleware, that would make a necessary rewrite of all links on the html pages.

@faustoct1
Copy link
Author

great. thanks my friend.
so, for a full proxy-reverse capabilities should I replace the payload on to /the/url/...?

@waterlink
Copy link
Owner

Yes, either change the source to use relative links, or add a Rack middleware, that will rewrite your HTML.

@kaspergrubbe
Copy link

Could someone maybe present som example code to do this? I think this is very a very common use-case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants