如何写入.htaccess

如何写入.htaccess,.htaccess,.htaccess,我已经尝试过了,但是没有找到适合PHP.htaccess 文件夹和文件信息: .htaccess (on root) /profile/personal.php /profile/exam/exam_information.php 从(personal.php)和(exam\u information.php)发送URL 我找到了htaccess,但它只适用于单个URL。请检查代码中的错误。 RewriteEngine On RewriteRule ^([a-zA-Z0-9-/]+)$ /p

我已经尝试过了,但是没有找到适合PHP
.htaccess

文件夹和文件信息:

.htaccess (on root)
/profile/personal.php
/profile/exam/exam_information.php
从(
personal.php
)和(
exam\u information.php
)发送URL

我找到了htaccess,但它只适用于单个URL。请检查代码中的错误。

RewriteEngine On

RewriteRule ^([a-zA-Z0-9-/]+)$ /profile/personal.php?pid=$1
RewriteRule ^([a-zA-Z0-9-/]+)/$ /profile/personal.php?pid=$1

个人信息和考试信息的友好URL都是相同的-Apache如何知道将URL重写到哪一个?如果有人请求/2012/A1PPOAQU7,是转到个人信息还是转到考试信息?但另一个在不同的目录中!你的问题不是很清楚。用户在其浏览器中请求的确切URL是什么?您标记的“友好URL”是什么?jocelyn编辑它…实际友好URL是2012/A1PPOAQU7…结果来自personal.php?pid=A1PPOAQU7@Reel:单击问题下的“编辑”链接,并进行必要的更改。
RewriteEngine On

RewriteRule ^([a-zA-Z0-9-/]+)$ /profile/personal.php?pid=$1
RewriteRule ^([a-zA-Z0-9-/]+)/$ /profile/personal.php?pid=$1