1

I am new in WordPress and I am trying to create a plugin that redirects to the target by picking up the same post from source URL to target URL. The user just needs to enter the URL he wants to redirect. The plugin will auto put the post URL by picking up from the source post to target post

for e.g: sc URL-

www.example.com/mypost/random-key-here

target url-

www.taga eturl.com/

plugin will auto add the post url and random key picking up from source url to target url like

www.targeturl.com/mypost/random-key-here

Please help me as i don't know how to create the admin grid and how to get the data from admin grid into code.

for more explanation: it can redirect if

www.example.com/mypost1/

to

www.example2.com/mypost1/

but it don't redirect auto

www.example.com/mypost/slide1

to

**`www.example2.com/mypost/`**

we need to make it so that it can redirect by replacing the main source post url with target url and other things remain same for e.g

www.example.com/mypost/slide1

replace the www.example.com/mypost/ with www.example2.com/mypost/ and other url auto add to target url (slide1). I am using https://wordpress.org/plugins/redirection/ this plugin but want to add this functionality to this.

  • Can you be a little more specific? Are you redirecting a specific handful of posts? Or are you redirecting all things? aka can you describe it as a rule using wildcards? I'm not sure what you mean by the admin grid either – Tom J Nowell Jan 3 '19 at 16:05
  • I'm confused as well. Where does the user enter the source url? Are you redirecting the entire site or just certain posts? When does it trigger? What is an admin grid? So many questions... – johnh10 Jan 3 '19 at 19:45
  • I want to make modification in the plugin that i have refereed. The plugin is only redirecting if the whole source matches with the url. but i am using slider in plugin so it adds numeric value of the slide to the url, so does redirection stopped working. the src and the target url are the same except the website url. so I want to redirect to the target url with the only the post url found in the url and want to redirect to the particular slide that user is watching. – Manish Kumar Jan 5 '19 at 6:28
  • 1
    There are hundreds of posts with each having around 60 slides. so if i start doing manualy it will take too much time. SO i want to do it pro grammatically – Manish Kumar Jan 5 '19 at 6:30
0

If my website had a directory called dogs (/dogs/) and I had 100 pages like this: -

https://www.codehaven.co.uk/dogs/page1/

https://www.codehaven.co.uk/dogs/page2/

https://www.codehaven.co.uk/dogs/page3/

I would not want to use a plugin to redirect every page manually. Therefore a redirect rule that looks for /dogs/ is useful like below.

RewriteEngine on

RewriteCond %{REQUEST_URI} /dogs/

RewriteRule .* /
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.