• Hello dear wordpress.org community!

    Recently, and I don’t even have a slight idea why, all wordpress rewrite rules have been deleted.

    To monitor them I’ve installed a rewrite plugin (Screenshot: http://prntscr.com/87piao ).

    Where can I get a backup of the original URL rewrite rules?
    I have a couple of database backups (SQL format), but I didn’t found the location of the rewrite rules.

    Please help!
    Best Regards & Thanks in advance

Viewing 5 replies - 1 through 5 (of 5 total)
  • Where are the rewrite rules stored?

    Typically in .htaccess in your public “root” folder.

    https://codex.wordpress.org/htaccess

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    https://www.google.com/search?q=wordpress+htaccess

    Thread Starter MrSteed

    (@mrsteed)

    Hey!

    Surely I’m aware of the .htaccess file.
    But these aren’t the only rules by far, there are quite more to handle permalinks for example (or woocommerce shop things in my case).

    I’ve heard that they are stored in the database, but it wasn’t mentioned where to find them.

    I’m talking about these rewrite rules:
    http://i.imgur.com/gFvsNXP.png

    These are the original rewrite rules from a new wordpress installation, but I need them to be imported in my old installation’s database to work properly again.

    Best Regards & Thanks in advance

    Please excuse me there. “Rules” sounds to me like “Code”, but yes, I do know code is sometimes at least stored in the database. In any case, your best bet might be to post in the Support Forum for whichever plugin is related:
    https://wordpress.org/plugins/search.php?q=woocommerce+shop

    Thread Starter MrSteed

    (@mrsteed)

    I think the rules in the .htaccess simply can’t be all rewrite rules required for wordpress permalinks.

    For example the rules considering author, comments, etc. sound to me very wordpress native, not only woocommerce specific.
    (Screen: http://i.imgur.com/B8VzTKS.png )

    Or am I wrong?

    WordPress offers a custom URL rewriting with the Rewrite API.
    The rewrite rules created within this API aren’t stored in the .htaccess file, according to my experience with them yet.

    Article: https://codex.wordpress.org/Rewrite_API/add_rewrite_rule

    So does anybody know the storage location of these custom URLs in the database?

    the rules considering author, comments, etc. sound to me very wordpress native, not only woocommerce specific.

    Understood, and the Codex link you provided shows them being used in php code in whatever files are part of WordPress or a given plugin. The database is essentially static, so the rules would be in php files even if certain parameters or variables or whatever might be drawn from the database.

    To monitor [the rules] I’ve installed a rewrite plugin

    I would try looking at the code in that plugin to try to figure out what it is reading from where.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Where are the rewrite rules stored?’ is closed to new replies.