Title: Slug issue
Last modified: August 28, 2020

---

# Slug issue

 *  [udaydahale11](https://wordpress.org/support/users/udaydahale11/)
 * (@udaydahale11)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/slug-issue-6/)
 * Hello sir,
 * I want to redirect marathi slug to my root site…but I dont have any solution 
   for this…
    for example… [https://www.xxxxxx.com/xxxxxx/आमचा](https://www.xxxxxx.com/xxxxxx/आमचा)
   माखनचोर/
 * to my root site…or any section….
 * Please help for this….
 * Please please please…………..
 * regards,
    UD
    -  This topic was modified 5 years, 8 months ago by [udaydahale11](https://wordpress.org/support/users/udaydahale11/).

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

 *  [Sundar](https://wordpress.org/support/users/phptechie/)
 * (@phptechie)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/slug-issue-6/#post-13327883)
 * Hi,
 * Open your “functions.php” file located in your theme (preferably a child theme)&
   paste the following code into it with required page slug.
 *     ```
       function redirect_page() {
   
            if (isset($_SERVER['HTTPS']) &&
               ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ||
               isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&
               $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
               $protocol = 'https://';
               }
               else {
               $protocol = 'http://';
           }
   
           $currenturl = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
           $currenturl_relative = wp_make_link_relative($currenturl);
   
           switch ($currenturl_relative) {
   
       <strong>        case '[from slug]':</strong>
                   $urlto = home_url('<strong>[to slug]</strong>');
                   break;
   
               default:
                   return;
   
           }
   
           if ($currenturl != $urlto)
               exit( wp_redirect( $urlto ) );
   
       }
       add_action( 'template_redirect', 'redirect_page' );
       ```
   
 * Step 1: Replace the sections in bold including the square brackets with the slugs
   you got from
 * Step 2: Save your changes.
 * All done!
    Thanks.
    -  This reply was modified 5 years, 8 months ago by [bcworkz](https://wordpress.org/support/users/bcworkz/).
      Reason: code fixed
 *  Thread Starter [udaydahale11](https://wordpress.org/support/users/udaydahale11/)
 * (@udaydahale11)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/slug-issue-6/#post-13337125)
 * not resolved my issue….
 * my site is https…
    -  This reply was modified 5 years, 8 months ago by [udaydahale11](https://wordpress.org/support/users/udaydahale11/).

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

The topic ‘Slug issue’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 2 participants
 * Last reply from: [udaydahale11](https://wordpress.org/support/users/udaydahale11/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/slug-issue-6/#post-13337125)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
