You have the rewrite argument defined inside the $labels array, move it out to the $args array:
$args = array(
'labels' => $labels,
'hierarchical' => true,
'rewrite' => array('slug' => 'projects', 'with_front' => true)
);
Related Posts:
- Need help with add_rewrite_rule
- Permalink format: singular or plural
- How to get pretty URLs with add_query_arg in permalinks
- How to add a custom URL placeholder to author archives?
- How to change author base without front
- permastruct for custom post type not working in one of four cases
- Remove parent slug for child pages
- Add custom directory in URL
- Include Taxonomy slug in post url
- Nice RSS Feed URLs for each custom post type
- Change the custom post type permalink
- Custom rewrite rules for feeds of custom queries (query_var query strings in URL)?
- Auto 301 to full post permalink? (using /posts/%post_id%/%postname%)
- Rewrite url / permalink for default archive – yearly / monthly
- Permalinks, Rewrites, Get Variables, Oh My!
- Change permalink for a single post entry
- How to Modify Existing Rewrite Rules?
- Image Attachment Url Rewrite
- Rewrite Page with a slug before page name
- Can’t get rewrite rules working
- Multilanguage URLs
- Rewrite my default post URL
- When is it a good idea to build a permalink structure from scratch?
- If the only permalink setting is %postname% what happens in the case of old duplicates?
- How to reset canonical URLs / fix redirect loop
- Attachment Page Permalink/URL Rewrite Issue. How to change the actual rewriting?
- Permalinks: Page Not Found
- Does changing a post title of a published post automatically change permalink?
- Remove custom taxonomy base from URL
- Add custom post type name in term link?
- Is a permastruct possible on pages?
- Rewrite rule for a query string
- How to add a variable as a tag base?
- WPML – how to get the permalinks to display also the default language
- How can i have a custom post type with more slugs for each post?
- URL rewriting: removing the site’s basename for a specific category
- How can I get this custom post type permalink structure? %custom_post_type%-%taxonomy%-%term-postname%
- Rewrite rule intended for CPTs gives 404 for pages
- Unable to get /%postname%/ permalinks working, 404 on all links
- Permalink structure between 2 custom post types and a taxonomy
- How to generate a list of all urls
- How to rewrite a URL to another rewritten URL without changing the address?
- Disable date based archives for all categories except one
- How to rename ‘Tag Base’ with WPeC 3.8?
- Custom rewrite rule ignored
- How can I emulate permalink behaviour on static pages
- wordpress how to replace url /bar with foo/bar for custom post type
- Getting back a permalink from custom url
- Permalinks on Windows IIS not working and web.config breaks site – does wordpress not support windows server now, if so how?
- Exclude single page from permalink rule
- Bulk append URL (add word to slug)
- How are WordPress Page URLs affected by permalink settings?
- WordPress pages and posts are redirecting to server IP address instead of domain URL [closed]
- Rewrite rule not passing variable
- Access posts while mod_rewrite is broken
- “set_front” => false on custom post type breaks wp_list_categories links [closed]
- rewrite based slug standar post wp
- remove SLASH on single_post but KEEP on categories and parent pages
- How to set the same base url for two different taxonomies?
- Make the blog page a child of another page and rewrite the blog url
- WordPress keeps removing query var from the URL
- How do I get the correct URL?
- How to construct a dynamic rewrite rule for child pages that passes more than one query var
- Custom permalink structure for custom post types including multiple taxonomy
- How can I access to the same post-type “page” from multiple different urls?
- Multiple URL rewrite rules and get every prams
- How to separate an overgrown blog into sub-blogs – without breaking existing inbound links?
- Using a template file for a specific custom URL
- Passing parameter through permalink structure
- Add word to permalinks does not transform the urls
- Why does page for hierarchical taxonomy parent term go 404?
- append current user-id to all internal permalinks
- rebuilding/ rewriting a url to make it SEO friendly
- No Ones Been Able to Override my WordPress Rewrite Rule Issue!
- My permalinks for all pages and posts now include old page titles as parents/categories
- Pagination links for taxonomy archive page 404 error on every page except first
- Pretty Filter URL
- WordPress Pagination Custom Rewrite Rule for Pages
- Change all pages permalinks instead of hierarchical to have id of the page
- How can I get .html URL suffixes in permalinks?
- rewrites and custom links in page need help with add_rewrite_rule
- Category-dependent custom permalink
- How to create an IIS7 re-write rule for a single category
- Prevent guessing slug
- All pages lead to home
- Although rewrite engine is on, I get 404 not found on every page
- Customized author slugs not working with get_author_posts_url method
- Remove index.php from WP 8.0 install migrated to IIS from Apache (still detecting Apache server)?
- Customize category permalinks
- Using a taxonomy value as part of a post URL
- ?posts_type=xxx not rewritten
- Custom permalink variable on single post
- URL to an image in a post is changing when permalink is set to custom. Can I avoid this?
- region selection
- WordPress custom permalinks, pages are now 404
- Include language variable in url
- Creating complex URLs with WordPress permalink structure
- permalinks url with woocommerce
- Blog url disappears
- Using a variable in page permalink