• Hello, I’m new at WordPress and I started by importing production site (files + database) to install it locally.
    The site works fine locally but I’ve something quite strange: The site has permalinks set to /%postname%/. It has Elementor + WPML + Yoast SEO modules installed and they are 4 languages set.

    On production server, the pdf document links URL of main language are correct : https://example.com/final_user_gc/
    The document link of translated document: https://example.com/de?p=12754

    After importing locally, the document link of translated document: https://localhost/de/final_user_gc/

    Why do I have 2 different links since it’s the same code and the same database ? I would like to have the same permalink as on the production server.
    Translated link is done in wpml-translation-management

    Thank you for helping a newbie

    • This topic was modified 5 years, 6 months ago by ggwin.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter ggwin

    (@ggwin)

    Additional info: Translated link is done in wpml-translation-managament controller but result link is on div class elementor-button-wrapper… so not really sure which one manages the translated link

    Most likely it is the permalinks setting and .htaccess file. For permalinks to work the .htaccess file must be correct.
    It is CHANKING the permalinks setting that changes the .htaccess file. Accordingly on your Settings panel change the permalinks settinbg to something else, and SAVE, then change the permalinks back to your chosen /%postname%/and SAVE again. Now test your links.

    Thread Starter ggwin

    (@ggwin)

    Hi RossMitchell, thank you for your reply.
    I’ve set the Permalink structure to “plain”, but then I cannot set the Permalink structure back in WP admin since the admin menus doesn’t work anymore (it also breaks the admin template). So I set the Permalink structure to “/%postname%/” in the database manually (wp_options.permalink_structure) but the permalink still doesn’t change. The strangest is that for the same code we have 2 behaviours completely different. The .htaccess is the same than in production except that locally we must add <IfModule mod_deflate.c> before SetOutputFilter DEFLATE (not present in production).

    Then locally or on production server, the URL are not the same. This is disappointing.

    That changing permalinks breaks you localhost site is a worry.
    Suggest that you check that the apache module “mod_rewrite” is enabled on your localhost.
    Save this php page and it will tell you this, and lots more. On localhost this file is safe, but if you ever put it up on accessible hosting make sure it has an obscure name, some of the details it displays could assist a hacker.
    PHP file, call it say “LHphpinfo.php”

    <?php
    
    phpinfo();
    
    ?>

    NOTE that there is no carriage return on the last line.

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

The topic ‘production server to localhost permalink different’ is closed to new replies.