2

I would like to create an alias on my site so that specific URLs will redirect to a specific page I have already created.

For example, if the user types in www.example.com/blog/products it will redirect to www.example.com/blog/?page=10

Is what I want to do possible with WordPress?

I do not want to modify my htacess.
I do not want to modify the template or add code anywhere.
I do not want to change my permalink structure.

Please do not suggest these methods. I do not mind installing a plugin if that's the only way.

3
  • You can do this using any redirect plugin. – Fayaz Feb 13 '17 at 12:27
  • A plugin with add code too though, otherwise (no offense) you can forget it. There's no magical way of doing this ;) – Jack Johansson Feb 13 '17 at 12:28
  • 1
    Your best bet is the Redirection plugin which gives you an interface to manage this, otherwise you would need to add the codes yourself – Tunji Feb 13 '17 at 12:30
1

Wordpress core doesn't have any means of managing redirects by itself. As you are excluding changes in the .htaccess file and adding code yourself, the only remainig option is to use a plugin.

If you search the WP Plugin Directory for 'redirect', you will find one very popular one (I sometime use it myself) but there are also many very specialized ones for sepecific use cases.

0

It is easily possible as long as both URL formats point to your WordPress installation. But it adds some milliseconds to page load time, since you will load some PHP scripts before the redirecting happens. If you use .htaccess or some server configuration file, the redirection will happen slightly earlier, especially on older PHP versions and without OPCache.

The quick and dirty solution would be:

  1. read $_SERVER["REQUEST_URI"] to find the requested path
  2. do DB queries to find out your corresponding post/page ID
  3. redirect with header('Location: '.$some_url); exit;
0

Like others mentioned, the only other route really is a plugin.

I will suggest this one as it is very easy to use and instead of manually typing redirects up, it will auto populate all your WordPress pages and posts and you can setup redirects that way, or manually. Plugin live at: https://wordpress.org/plugins/eps-301-redirects/screenshots/enter image description here

Very clean, very simple! :)

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.