Permalinks changed with WordPress 4.9

Found the issue! Seems that the <Directory> in the .conf file in Apache2 was not configured correctly. An example of a correctly configured .conf file is as follows: # domain: exampleurl.com # public: /var/www/html/exampleurl.com/public_html/ <Directory /var/www/html/exampleurl.com/public_html> Require all granted AllowOverride All </Directory> <VirtualHost *:80> ServerAdmin [email protected] ServerName exampleurl.com ServerAlias www.exampleurl.com DocumentRoot /var/www/html/exampleurl.com/public_html ErrorLog /var/www/html/exampleurl.com/logs/error.log CustomLog … Read more

Add a URL prefix to permalinks of News category and sub-categories of posts only

add_action( ‘init’, ‘wpa_category_base’ ); function wpa_category_base() { // Remember to flush the rules once manually after you added this code! add_rewrite_rule( // The regex to match the incoming URL ‘news/([^/]+)/([^/]+)/([^/]+)(/[0-9]+)?/?$’, // The resulting internal URL ‘index.php?category_name=$matches[1]/$matches[2]&name=$matches[3]&paged=$matches[4]’, // Add the rule to the top of the rewrite list ‘top’ ); } Custom permalink structure: /media/%category%/%postname%/ Category … Read more

How to write correct add_rewrite_rule in WordPress for more than one taxonomy in one rule?

Changed URL formats to be like: /services/home-care/COUNTY/TOWN add_rewrite_rule( ‘services/([^/]*)/([^/]*)/([^/]*)/?’, ‘index.php?post_type=”ag_location”&ag_primary_inspection_cat=$matches[1]&ag_cities=$matches[3]’, ‘top’ ); add_rewrite_rule( ‘services/([^/]*)/([^/]*)/?’, ‘index.php?post_type=”ag_location”&ag_primary_inspection_cat=$matches[1]&ag_county=$matches[2]’, ‘top’ ); add_rewrite_rule( ‘services/([^/]*)/?’, ‘index.php?post_type=”ag_location”&ag_primary_inspection_cat=$matches[1]’, ‘top’ ); Based on this solution

Can’t get rewrite rules working

By ‘existing page’ do you mean a WordPress page? My experience with rewrites is routing everything to index.php with whatever extra query vars you need, I think attempting to route it to edit is one of your issues, not entirely clear on your intent there. Go download Monkeyman Rewrite Analyzer if you don’t already have … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)