我试图为我心中的某个问题找到答案, 但似乎我找不到答案。
怎么可能用“?” 和“=” 来做一些php 。
例一(1):
example.com/user.php?profile=example
至:
example.com/user/profile/example
例二(2):
example.com/forum.php?thread=example-in-an-example
至:
example.com/forum/thread/example-in-an-example
将第二个“/” (斜线) 当作“?” 的代码, 第三个和其余作为“=” 的代码, 这样我就可以自由地使用它, 而不是为每页制作新的代码...
LIKE: /forum (or any others) is like the page itself AND: /thread (or any others) is like the $_GET AND: /example-in-an-example (or any others) is like the value to the $_GET
EXTRA: here is a code from Jeroen:
RewriteRule ^(.*)/(.*)/(.*)/$ $1.php?$2=$3 [L]
Problem one (1): when going to like: "example.com/forum" or "example.com/user" its giving a 404 error Problem two (2): When using links like "example.com/forum/thread/test-thread/reply/2" it gives 404 error, (supose to loop with "&" and "=" after making the 1st real one so its enable to use more than one $_GET)