Forums

[resolved] Custom Post Type & Taxonomy Permanlink Rewrite Not Working (4 posts)

  1. mathiasvagni
    Member
    Posted 6 months ago #

    The last two days I have tried everything I can think of and can not get permalink rewrites to work on my custom post type and taxonomy.

    You can see my register post type and custom taxonomy code here: http://pastebin.com/waKwFMHt (I temporarily set the rewrite to false after almost giving up).

    At the moment the archive of a custom taxonomy is:
    http://www.sampleurl.com/?project-type=projects

    And a single post is in that taxonomy is:
    http://www.sampleurl.com/?portfolio=post-name

    From my understanding, just by setting rewrite true on both my taxonomy and post type, it should rewrite the two above as:
    http://www.sampleurl.com/project-type/projects
    http://www.sampleurl.com/portfolio/post-name

    I couldn't get that to work.
    EDIT: It did change the urls to above but I get a 404 :(

    What I would ideally like to have is this:
    http://www.sampleurl.com/portfolio/projects
    http://www.sampleurl.com/portfolio/branding
    http://www.sampleurl.com/portfolio/categoryname
    .ect for any category of my custom post type

    and then this for my single post in my custom post type.
    http://www.sampleurl.com/portfolio/categoryname/postname

    I'm really stuck and would greatly appreciate any help!

  2. paulieb13
    Member
    Posted 5 months ago #

    Were you able to get this working? I'm having the same trouble, but have yet to resolve it. Could you explain how you got it to work?

  3. mathiasvagni
    Member
    Posted 4 months ago #

    I did. I was doing it right all along. I simplify found out that certain names can't be used for the rewrites. (I.e there are some temperamental conflicts with certain names such as the same name as the custom taxonomy or post-type ect.)

    Also, i found that a more reliable way to flush the rewrites and see if they work is simply click on the settings -> permalink option. I was trying to flush the rewrites myself and that was evidently not working well.

    Give it a go. Otherwise, you could post some code?

  4. webstranka
    Member
    Posted 4 months ago #

    I had same problem, but I did create .htaccess file, as it was not there (check if not hidden).
    I used this code, suggested by WP:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    and done :)

Reply

You must log in to post.

About this Topic