I've made a WordPress website people can rent cars from brokers. So I have 2 custom post types:
- broker
- car
There are about 10 different cars on the website. All these cars are for each broker exactly the same.
So I've created a page template page-brokers.php that lists all the brokers. If you click on a broker, you go to the detail page of the broker single-broker.php
The URL is saferental.be/broker/broker-name
On the detail page of the broker, you'll see all the 10 different cars. If you click on a car, you go to the car detail page, which is single-car.php
The URL is saferental.be/car/car-name
At the bottom of the car detail page, is a form to contact the broker you've selected previously. As you see in the URL, there is nothing mentioned of the selected broker.
When you select a broker, its information is saved in a session and pushed into hidden fields in the form.
Everything works perfectly: - You select a broker - You pick a car -> go to the car detail page - Submit the car detail page form which sends the information to the selected broker.
The result I want to have:
- If you select a broker, you go to the detail page saferental.be/broker/broker-name/ (this is already okay)
- If you select a car, you go to the car detail page which should be something like this: saferental.be/broker/broker-name/car/car-name
Test website: http://safelease.houston-1.hybridmedia.be/
The brokers are at the bottom of the homepage.
/broker/broker-name/car/car-name); however, it might be easier for you to use plugin like Redirection - and with this plugin, just create a new redirect with these settings: a) "Source URL":/broker/([^/]+)/car/([^/]+)b) "Regex" checkbox: checked c) "When matched":Pass-throughd) "Target URL":/car/$2- Sally CJ