Wordpress Permalinks : How to?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hausarzt
    Confirmed User
    • Jan 2011
    • 818

    #1

    Tech Wordpress Permalinks : How to?

    Hi Folks.

    Is there any way to achive this permalink strukture?

    DOMAIN/CATEGORY/SUBCATEGORY/SUBCATEGORY

    mysite.org/cars/bmw/engine
    mysite.org/cars/audi/engine
    mysite.org/cars/ford/engine

    The problem is the category "engine". As far as I know, it's not possible to have a slug multiple times. Any plugins, coders, hacks to make this possible?
    I know, my english is bad. But your german might be even worse
  • fris
    Too lazy to set a custom title
    • Aug 2002
    • 55679

    #2
    you can use the rewrite api to pretty much do anything, i would look into that.
    Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

    Comment

    • zerovic
      Confirmed User
      • Apr 2010
      • 1116

      #3
      actually it's not that hard once you understand how this works.. the most basic example would be

      create a file called .htaccess and paste this into it

      <IfModule mod_rewrite.c>

      RewriteEngine On

      RewriteRule ^([^/]+)/([^/]+)/([^/]+) index.php?first=$1&second=$2&third=$3 [NC,L]

      </IfModule>
      save it and upload it to your server

      now create the index.php file

      <?php

      print_r($_GET);

      ?>
      upload both to your server and open up

      domain.com/cars/bmw/engine

      it will print something like

      Array ( [first] => cars [second] => bmw [third] => engine )

      Regards.
      php, html, jquery, javascript, wordpress - contact me at contact at zerovic.com

      Comment

      • zerovic
        Confirmed User
        • Apr 2010
        • 1116

        #4
        also, make sure to block folders you don't want .htaccess to use... to do this, simply add for example

        RewriteRule ^images - [L,NC]
        before the RewriteEngine On
        php, html, jquery, javascript, wordpress - contact me at contact at zerovic.com

        Comment

        Working...