相关疑难解决方法(0)

What does the =$1 mean in url rewriting?

I can't find any information on stackoverflow or google about the meaning of =$1. I get superficial information but nothing for beginners like me. What does it do?

If I have something like this:

www.website.com/profile.php?simon
Run Code Online (Sandbox Code Playgroud)

Does the name simon correspond to the $1 variable and why 1?

This is how I understand it:

  • (.*) profile/profile.php?id=$1

The bold corresponds to:

  • www.website.com/profile.php?id=simon

Converted with rewrite it becomes:

  • www.website.com/profile/simon

Am I missing something here?

Edit:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.php …
Run Code Online (Sandbox Code Playgroud)

php .htaccess mod-rewrite

2
推荐指数
1
解决办法
3585
查看次数

标签 统计

.htaccess ×1

mod-rewrite ×1

php ×1