.htaccess rewrite query

Not sure how to go about doing this or if it’s possible but hoping someone on here can help me.

This is the URL that a user clicks, it’s not on my website and I can’t change the formatting of this URL at all.
http://www.mywebsite.co.uk/locator?id=201410258489GHT&part=ABC123&ref=123456

Is there a way that I can get this to change to something like the below when the user comes through to my website?
http://www.mywebsite.co.uk/locator/201410258489GHT/ABC123/123456

Any help would be appreciated

Short and sweet: no

It’s not your server, so you don’t have any control over the URLs.

So the user clicks the first link, which is on another website. Which takes them to your site, but you want the url to appear differently when they arrive?

If I’m understanding that correctly, you can definitely do that with htaccess, but you realize that the ?id=201410258489GHT&part=ABC123&ref=1234561 part of the url is there for a reason, right? It’s passing $_GET information.

It’s not your server, so you don’t have any control over the URLs.

That may be true, but I don’t know how you’d know that from the OP without clarifying details. He didn’t even mention the server, merely that he doesn’t own the linking website.

Oops, I read the question wrong. I thought the OP wanted to change an outgoing and find a way for the other party to accept their format. I see now that it’s the other way around … :blush:

That can indeed be done with .htaccess, but as you say more info is needed.

@sketchgal Does you website already understand the new URL format? (i.e., the /locator/201410258489GHT/ABC123/123456 format)

@Rémon,

Thanks for correcting yourself.

This question seems to be the same one asked a few years ago when I originally answered “no” because it would be “loopy code” to redirect to a URL (format) which can’t be served (then serve the correct file by redirecting back to the original format).

Once again, that’s been answered and the best (remaining) answer is located in my rewriting tutorial at http://dk.co.nz/seo - use Page Contents to look for Redirect to New Format as the answer is explained there.

Regards,

DK

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.