GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Webmaster Q & Fuckin' A (https://gfy.com/forumdisplay.php?f=27)
-   -   Tech Wordpress Permalinks : How to? (https://gfy.com/showthread.php?t=1173581)

hausarzt 09-08-2015 10:52 PM

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?

fris 09-14-2015 04:07 AM

you can use the rewrite api to pretty much do anything, i would look into that.

zerovic 09-30-2015 06:29 AM

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

Quote:

<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

Quote:

<?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.

zerovic 09-30-2015 06:36 AM

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

Quote:

RewriteRule ^images - [L,NC]
before the RewriteEngine On


All times are GMT -7. The time now is 06:54 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc