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 in Digital Marketing by Kichu
• 19,040 points
367 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 in Digital Marketing by Kichu
• 19,040 points
362 views
0 votes
0 answers

nginx clean url with seo friendly file names

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

Mar 2 in Digital Marketing by Kichu
• 19,040 points
224 views
0 votes
0 answers

Producing SEO friendly URL in javascript

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

Mar 5 in Digital Marketing by Kichu
• 19,040 points
188 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 in Digital Marketing by Kichu
• 19,040 points
102 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 in Digital Marketing by narikkadan
• 37,660 points
626 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 in Digital Marketing by Kichu
• 19,040 points
68 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 in Others by narikkadan
• 37,660 points
1,735 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 in Others by narikkadan
• 37,660 points
576 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 in Others by narikkadan
• 37,660 points
78 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,100 points
4,660 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