Skip to main content
Tweeted twitter.com/StackWebmasters/status/678597731896664064
URL formatting, exemplified domain according to FAQ. Made different folder more obvious.
Source Link
MrWhite
  • 43.1k
  • 4
  • 50
  • 90

I have two type domaintypes of URL and want to rewrite it for friendly URL.

1. The first:

https: //mydomain.ltd/folder/myfile.php?id=xx&param1=yy

https://example.com/folder/myfile.php?id=xx&param1=yy

I want itto rewrite to:

https: //mydomain.ltd/folder/myfile/xx/yy

https://example.com/folder/myfile/xx/yy

2. The secondssecond:

https: //mydomain.ltd/folder1/myfile.php?id=xx&param1=yy

https://example.com/another-folder/myfile.php?id=xx&param1=yy

I want it rewrite to:

https: //mydomain.ltd/myfile/xx/yy

https://example.com/myfile/xx/yy

Please help me how to do it. I've searched from google but I do not understand the principle rewrite. Thank you verymuch! Please help me how to do it. I've searched Google but I do not understand the principle rewrite.

I have two type domain and want to rewrite it for friendly URL.

1. The first:

https: //mydomain.ltd/folder/myfile.php?id=xx&param1=yy

I want it rewrite to:

https: //mydomain.ltd/folder/myfile/xx/yy

2. The seconds:

https: //mydomain.ltd/folder1/myfile.php?id=xx&param1=yy

I want it rewrite to:

https: //mydomain.ltd/myfile/xx/yy

Please help me how to do it. I've searched from google but I do not understand the principle rewrite. Thank you verymuch!

I have two types of URL and want to rewrite it for friendly URL.

1. The first:

https://example.com/folder/myfile.php?id=xx&param1=yy

I want to rewrite to:

https://example.com/folder/myfile/xx/yy

2. The second:

https://example.com/another-folder/myfile.php?id=xx&param1=yy

I want it rewrite to:

https://example.com/myfile/xx/yy

Please help me how to do it. I've searched Google but I do not understand the principle rewrite.

Source Link

nginx rewrite for an url with parameters

I have two type domain and want to rewrite it for friendly URL.

1. The first:

https: //mydomain.ltd/folder/myfile.php?id=xx&param1=yy

I want it rewrite to:

https: //mydomain.ltd/folder/myfile/xx/yy

2. The seconds:

https: //mydomain.ltd/folder1/myfile.php?id=xx&param1=yy

I want it rewrite to:

https: //mydomain.ltd/myfile/xx/yy

Please help me how to do it. I've searched from google but I do not understand the principle rewrite. Thank you verymuch!