WordPress custom permalinks, pages are now 404

You need to setup your permalinks for menutype using custom rewrite rules. What you’ve done is apply the menutype prefix to everything, even though menutype isn’t relevant to everything, so things are being misinterpreted. You would need something similar to this: function custom_rewrite( $wp_rewrite ) { $feed_rules = array( ‘([^/]+)(/[0-9]+)?/?$’ => ‘index.php?menu_type=”. $wp_rewrite->preg_index(1).”&post_name=”. $wp_rewrite->preg_index(2) ); … Read more

New rewrite rules for custom taxonomy and reuse default

Note that the url-rewriting doesn’t directly determine the template used. A pretty url is interpreted as a query and then that query determines what template is used based on the template hierarchy. So only need one rule: example.com/localdeals/myterm => example.com/?location=myterm WordPress will look for the template taxonomy-location-myterm.php and use that (if it exists) or otherwise … Read more

WordPress Rewrite Rules

First you have to filter query vars and add your query var to the array: add_filter( ‘query_vars’, ‘wpa56345_query_vars’ ); function wpa56345_query_vars( $query_vars ){ $query_vars[] = ‘cat_id’; return $query_vars; } Then your rule which captures any digits after your pagename coupons and passes that as cat_id: add_action( ‘init’, ‘wpa56345_rewrites’ ); function wpa56345_rewrites(){ add_rewrite_rule( ‘coupons/(\d+)/?$’, ‘index.php?pagename=coupons&cat_id=$matches[1]’, ‘top’ … Read more

Custom Taxonomy in Permalink from post type

Set your taxonomy slug to taxonomy_name and in your post type set the slug to taxonomy_name/%taxonomy_name_term% and flush rewrite rules (simply by going to permalink settings panel in the admin) And after that WordPress will be able to handle /taxonomy_name/%taxonomy_name_term%/post-name/ URLs. So all that is left to do is tell WordPress what %taxonomy_name_term% means and … Read more

Rename page URL

I have tried some add_rewrite_rule magic and query variables and it worked. Thanks for the help everyone. If in case anyone want to refer the answer: add_filter( ‘query_vars’, ‘wpse26388_query_vars’ ); function wpse26388_query_vars( $query_vars ){ $query_vars[] = ‘custom_gallery_id’; return $query_vars; } add_rewrite_rule( ‘topic/([^/]+)/([^/]+)/gallery/([0-9]+)/?$’, ‘index.php?pagename=gallery&custom_gallery_id=$matches[3]’, ‘top’ ); I was able to solve my problem with this.

Rewrite function

Go to Settings->Permalinks Add this to Custom Structure: /%postname%/ Update WordPress generates .htaccess-files for this. Just go to your root and activate the show invisable files on your computer. Here is the htaccess for the structure: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d … Read more

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