i have a url shortner plugin for wordpress i can add links like: www. google. com/file.get-2323 www. bing. com/hello-oo it gets me then short urls as next: http:// domain. com/f6b5e21d54 http:// domain. com/a610d31cde but i want full permelink as the orginal urls. so i want the short urls as: http:// domain. com/f6b5e21d54/file.get-2323 http:// domain. com/a610d31cde//hello-oo i have the php file here under, can somebody please tell me what i need to change to get this result? here is the php code: http://pastebin.com/RVf4HPSz
You are getting "slugs" mixed up with "permalinks" but I get what you are trying to do (puzzled about the why, but I get the what). What isn't working in your script?
Your probably want to issue a curl request. curl_setopt($ch, CURLOPT_FOLLOWLOCATION,true); echo curl_getinfo($ch, CURLINFO_EFFECTIVE_URL); PHP:
Oh actually I made a mistake, I didn't read your question properly. You'd have to look into https://codex.wordpress.org/Rewrite_API/add_rewrite_rule
As I understand it, he has an url-disguiser/url-shortener that hides the original url - how it works is anybody's guess. He wants to change the shortened url to something almost the same as the originally shortened url, but add the actual end object for the link at the end of the shortened url. Why, I have no idea. However, this all depends on how the url-shortener is coded, and since he doesn't tell us which one he uses, or give us the code for it, we can't help him. However, I doubt it will be a simple rewrite, since that url-rewriter has to store the connection between the shortened url and the original url somewhere, probably in the database, and changing the output will probably break it.
He does though, it's in the pastebin - I just can't be arsed setting up a test environment to work out what it's doing now, what errors he's getting etc
He's not getting any errors, the code produces a post with a shorcode. What he wants to do is append a directory path to the end of the shortcode . So instead of of /asdasd123/ , he wants /asdasd123/something Easiest way I can think of is a simple rewrite rule within wordpress.
I can, but you give us code and you don't tell us where the code falls short. I'm assuming it's not actually your code but it would help if you could tell us what you've tried, etc. It looks pretty straight forward but you have to help us help you. This might help http://sandbox.onlinephpfunctions.com/code/48eed6da063f15618d926eebc3c8f2254da1c090 and then you just need to update your wordpress plugin
Doesn't quite accomplish what he wanted, he wants the wordpress slug to look like /RANDOMSTRING/EXTRASTUFF
The OP didn't say anything about the links being recognised by wordpress - I figured he would be passing them through some affiliate link system I'm guessing though. This whole thread is a mystery.