开发者

.htaccess, friendly url parameters

开发者 https://www.devze.com 2023-02-15 15:17 出处:网络
I\'m trying to solve this: control.mysite.com/?v=customers control.mysite.com/?v=providers control.mysite.com/?v=customers&id=1234

I'm trying to solve this:

control.mysite.com/?v=customers

control.mysite.com/?v=providers

control.mysite.com/?v=customers&id=1234

control.mysite.com/?v=providers&id=5678

for this:

control.mysite.com/customers

control.mysite.com/providers

control.mysite.com/customers/1234

control.mysite.com/providers/5678

I've checked what kristen asked here but no answer yet. Also I found a lot of related questions but they have not what I'm looking for or are hard to 开发者_如何学编程adapt/implement.

Edit: I forgot to mention that I'm running this site in a subdomain. I don't know if could affect.


Can you please try this?

RewriteEngine On
RewriteRule ^([^/]*)$ /?v=$1 [L]
RewriteRule ^([^/]*)/([^/]*)$ /?v=$1&id=$2 [L]

Or just refer the site below...

http://www.generateit.net/mod-rewrite/

0

精彩评论

暂无评论...
验证码 换一张
取 消