Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Double Slashes at the start of the path when redirecting to an absolute url #177

Open
ProNotion opened this issue Dec 19, 2017 · 6 comments
Assignees
Labels

Comments

@ProNotion
Copy link

When creating a redirect to an absolute url e.g /old-url to http://example.com/new-url you end up with the path beginning with // and so get a final url of http://example.com//new-url which causes issues.

I've patched it and will submit a pull request shortly.

ProNotion added a commit to ProNotion/UrlTracker that referenced this issue Dec 19, 2017
…a path when redirecting to an absolute url
@daniel-chenery
Copy link
Collaborator

Fab, thanks.

I'll try and take a look during/after Christmas, ensure everything works okay still and deploy in the New Year :)

@ProNotion
Copy link
Author

No worries, I'm having to use a custom build for now.

@daniel-chenery
Copy link
Collaborator

@ProNotion I've tried to replicate this before pulling in your request, but I can't replicate it to ensure your fix will work. Perhaps I'm missing a step?

I've done the following
Old URL: http://www.example.com/old-page/
New URL: http://www.example.com/new-page/

Upon save, the domain gets removed from the old URL, converting it to a relative URL.
Navigating to /old-page/, will take me to /new-page/

@ProNotion
Copy link
Author

Hi Daniel,

Sorry I should have been clearer. The absolute url would be for an external address. So if my site domain was http://www.example.com/ and my old url was /old-url/ and the redirect was to http://www.anotherdomain.com/new-url/ this is where the problem occurs.

@daniel-chenery
Copy link
Collaborator

Hi,

I'm afraid I still can't replicate your issue.

This is exactly how I have the redirect in Umbraco at the moment
image

And rightly enough, going to localhost/external-url/ will redirect me, with no extra slashes.

Is this how your setup is? Do let me know if I've missed something.

I'm using UrlTracker 3.14.1, and Umbraco 7.7.6

@ProNotion
Copy link
Author

@daniel-chenery Try leaving the trailing slash off of your redirect url and adding a querystring value something like this:

image

ProNotion added a commit to ProNotion/UrlTracker that referenced this issue Jun 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants