Title: Funky permalinks settings
Last modified: August 31, 2016

---

# Funky permalinks settings

 *  Resolved [rudym](https://wordpress.org/support/users/rudym/)
 * (@rudym)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/funky-permalinks-settings/)
 * Hi,
 * So I finally get a live site set up locally for development and it’s mostly ok.
   What I just noticed is that the links do not seem to work. So I go to the permalink
   settings through the dashboard, just to view, and suddenly Voila! All links work
   now upon clicking to view permalink settings. What gives?

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

 *  [Joms](https://wordpress.org/support/users/jomsky/)
 * (@jomsky)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/funky-permalinks-settings/#post-7094809)
 * WP caches rewrite rules. So when a plugin or a theme modifies a rule the cache
   should be regenerated to reflect the changes. This can’t be done on every page
   load since this will considerably slow the website down. So WordPress flushes
   the rewrite rules on the Permalink settings page.
 *  Thread Starter [rudym](https://wordpress.org/support/users/rudym/)
 * (@rudym)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/funky-permalinks-settings/#post-7094901)
 * Ok, I’m looking to mimic a similar thing using WP-CLI and figured something like:
 * `wp rewrite flush --hard --path=c:\xampp\htdocs\mywordpress`
 * But this doesn’t do it. In the permalinks page, it executes `flush_rewrite_rules()`.
   How can I execute this WP function?
 *  [Joms](https://wordpress.org/support/users/jomsky/)
 * (@jomsky)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/funky-permalinks-settings/#post-7094999)
 * Just for context why/where do you want to flush the rewrite rules? If it’s for
   a plugin I suggest calling flush_rewrite_rules() on plugin activation/deactivation.
   You can find some code snippets here: [https://codex.wordpress.org/Function_Reference/flush_rewrite_rules](https://codex.wordpress.org/Function_Reference/flush_rewrite_rules)
 *  Thread Starter [rudym](https://wordpress.org/support/users/rudym/)
 * (@rudym)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/funky-permalinks-settings/#post-7095020)
 * My issue seems to be that once I download and deploy WordPress from backup in
   my localhost machine, the links don’t work right away. So, I log in and just 
   VIEW the permalink settings, without saving, and the links work thereafter.
 * I’m not sure why this is the case, but so far I haven’t found a way to mimic 
   this without having to manually logging in to view the permalink settings. And,
   upon review of the options-permalink.php page, I just stumbled across the call
   to flush_rewrite_rules(), and thought this was the trick. But, as I alluded to,
   the wp-cli command doesn’t seem to do the trick. I even tried to alter this directly
   in MySQL, but still no dice.
 *  Thread Starter [rudym](https://wordpress.org/support/users/rudym/)
 * (@rudym)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/funky-permalinks-settings/#post-7095022)
 * This problem seems to occur whenever I deploy a backup of my wordpress, both 
   DB and WordPress files.
 *  Thread Starter [rudym](https://wordpress.org/support/users/rudym/)
 * (@rudym)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/funky-permalinks-settings/#post-7095065)
 * Ok, one last thing that resolved this for me. Review the .htacess file (located
   in the root of your WordPress folder). It should be something like:
 * >  # BEGIN WordPress
   >  <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /
   > mywordpress/ RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME}!-
   > f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /mywordpress/index.php [
   > L] <IfModule> # END WordPress

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

The topic ‘Funky permalinks settings’ is closed to new replies.

## Tags

 * [development](https://wordpress.org/support/topic-tag/development/)
 * [permalink](https://wordpress.org/support/topic-tag/permalink/)
 * [xampp](https://wordpress.org/support/topic-tag/xampp/)

 * In: [Localhost Installs](https://wordpress.org/support/forum/localhost-installs/)
 * 6 replies
 * 2 participants
 * Last reply from: [rudym](https://wordpress.org/support/users/rudym/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/funky-permalinks-settings/#post-7095065)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
