Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Wordpress htaccess for URL

$
0
0
I'd love some help, already struggling for 2 weeks on this one:

I'm moving my Wordpress form Apache to Nginx.

On Apache we used .htaccess

<IfModule mod_rewrite.c>
RewriteRule ^business/([^/]*)/([^/]*)$ /business/?id=$1 [L,P]
</IfModule>

to create this nice looking URL of each user's profile page website.com/business/6/company-name
in which 6 is the user ID and company-name the user's company (the url works with any text behind the 6)

In Ngnix I want the same:

When someone types website.com/business/6/company-name
he should get the data from website.com/business/?id=6
but see the URL still as website.com/business/6/company-name

All I've achieved is for website.com/business/6/company-name to redirect website.com/business/?id=6

location /business-profile {
rewrite ^/business-profile/([^/]*)/([^/]*)$ /business/?id=$1? redirect;
}

How do I make it so that the user only sees my nice URL website.com/business/6/company-name ?

Any help much appreciated!

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>