Title: Relative? URL Redirection (using perhaps PHP)
Last modified: January 31, 2018

---

# Relative? URL Redirection (using perhaps PHP)

 *  [labrecquev](https://wordpress.org/support/users/labrecquev/)
 * (@labrecquev)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/relative-url-redirection-using-perhaps-php/)
 * When I migrate my website from local to production, I have to manually change
   the redirection links from localhost to my website’s URL. Is there a way to automate
   this maybe using PHP?
 * E.g. <?php echo (some PHP function for URL) ?>
 * … instead of hardcoding the redirect link and changing it.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [caimin_nwl](https://wordpress.org/support/users/caimin_nwl/)
 * (@caimin_nwl)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/relative-url-redirection-using-perhaps-php/#post-9930606)
 * Do you mean the redirect links in the LWA settings?
 *  Thread Starter [labrecquev](https://wordpress.org/support/users/labrecquev/)
 * (@labrecquev)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/relative-url-redirection-using-perhaps-php/#post-9930967)
 * Yes, exactly
 *  [caimin_nwl](https://wordpress.org/support/users/caimin_nwl/)
 * (@caimin_nwl)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/relative-url-redirection-using-perhaps-php/#post-9939238)
 * Sorry, unfortunately it’s not possible to use PHP code in the settings panel.
   Maybe using a relative URL, instead of an absolute one, would help?
 *  Thread Starter [labrecquev](https://wordpress.org/support/users/labrecquev/)
 * (@labrecquev)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/relative-url-redirection-using-perhaps-php/#post-9940547)
 * It sounds like a good idea. I will try to simply put the relative link, omitting
   the complete website address.
    E.g. inputting /shop instead of [http://www.mywebsite.com/shop](http://www.mywebsite.com/shop)
   in the redirection field?
 * It would solve my problem as I want the users to be redirected to the shop page.
 *  [caimin_nwl](https://wordpress.org/support/users/caimin_nwl/)
 * (@caimin_nwl)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/relative-url-redirection-using-perhaps-php/#post-9943041)
 * Yes, if the basic URL structure is the same on both sites that should work fine.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Relative? URL Redirection (using perhaps PHP)’ is closed to new replies.

 * ![](https://ps.w.org/login-with-ajax/assets/icon-256x256.png?rev=976165)
 * [Login With Ajax - Fast Logins, 2FA, Redirects](https://wordpress.org/plugins/login-with-ajax/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/login-with-ajax/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/login-with-ajax/)
 * [Active Topics](https://wordpress.org/support/plugin/login-with-ajax/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/login-with-ajax/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/login-with-ajax/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * 5 replies
 * 2 participants
 * Last reply from: [caimin_nwl](https://wordpress.org/support/users/caimin_nwl/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/relative-url-redirection-using-perhaps-php/#post-9943041)
 * Status: not resolved