Replacement of parameters in seo url with htaccess

0 votes
My url:

x.com/ara?il=istanbul&ilce=avcilar&marka=opel&model=corsa

x.com/rent/istanbul-avcilar-opel-corsa

In htaccess:

RewriteRule ^rent/([0-9a-zA-Z-_]+)-([0-9a-zA-Z-_]+)-([0-9a-zA-Z-_]+)-([0-9a-zA-Z-_]+)$ ara.php?il=$1&ilce=$2&marka=$3&model=$4 [L,QSA]
it does not work if there is no ilce or model parameter in the URL. but otherwise it works perfectly

So I want it to work also in these situations

x.com/ara?il=istanbul&marka=opel&model=corsa
x.com/rent/istanbul-opel-corsa

x.com/ara?il=istanbul&marka=opel
x.com/rent/istanbul-opel

x.com/ara?il=istanbul&ilce=avcilar&marka=opel
x.com/rent/istanbul-avcilar-opel
How should htaccess be for this?
Mar 8, 2022 in Digital Marketing by Kichu
• 19,050 points
1,104 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Digital Marketing

0 votes
0 answers

.htaccess give 404 Not Found when url in SEO-friendly URL

Im using opencart fresh install and using ...READ MORE

Mar 4, 2022 in Digital Marketing by Kichu
• 19,050 points
815 views
0 votes
0 answers

nginx clean url with seo friendly file names

I wish to implement the following which ...READ MORE

Mar 2, 2022 in Digital Marketing by Kichu
• 19,050 points
507 views
0 votes
0 answers

Producing SEO friendly URL in javascript

I have a PHP function that converts ...READ MORE

Mar 5, 2022 in Digital Marketing by Kichu
• 19,050 points
458 views
0 votes
0 answers

SEO URL for information pages in opencart not working

I'm trying to create custom SEO URL's ...READ MORE

Mar 8, 2022 in Digital Marketing by Kichu
• 19,050 points
590 views
0 votes
1 answer

How to get Stack Overflow SEO friendly URL structure in Nuxt.js?

The following worked for me : To get ...READ MORE

answered Mar 11, 2022 in Digital Marketing by narikkadan
• 63,420 points
1,386 views
0 votes
0 answers

Replace tags with space in PHP for SEO Meta Description

I am trying to strip tags from ...READ MORE

Mar 12, 2022 in Digital Marketing by Kichu
• 19,050 points
425 views
0 votes
1 answer

Generator URL Friendly SEO PHP with .htaccess

Options +FollowSymLinks -MultiViews RewriteEngine on RewriteBase / # skip all ...READ MORE

answered Feb 14, 2022 in Others by narikkadan
• 63,420 points
3,732 views
0 votes
1 answer

mod_rewrite seo friendly url passed as parameter only works with prefix on url

RewriteEngine On RewriteRule ^content/get_content.php\?url\=seo-friendly-url$ /content/seo-friendly-url [L] try this code ...READ MORE

answered Feb 24, 2022 in Others by narikkadan
• 63,420 points
1,452 views
0 votes
1 answer

mod_rewrite seo friendly url passed as parameter only works with prefix on url

RewriteEngine On RewriteRule ^content/get_content.php\?url\=seo-friendly-url$ /content/seo-friendly-url [L] try this code ...READ MORE

answered Feb 27, 2022 in Others by narikkadan
• 63,420 points
425 views
0 votes
1 answer

htaccess redirect + hide subfolder in url

I found this after searching, Try this rule: # ...READ MORE

answered Aug 10, 2018 in AWS by Priyaj
• 58,090 points
5,849 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP