Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在我的子目录htaccess文件中编写重写规则来实现这一点_Php_.htaccess_Url Rewriting - Fatal编程技术网

Php 如何在我的子目录htaccess文件中编写重写规则来实现这一点

Php 如何在我的子目录htaccess文件中编写重写规则来实现这一点,php,.htaccess,url-rewriting,Php,.htaccess,Url Rewriting,我的公共html文件夹下有一个名为“apps”的子目录。我获取“apps”数据库表记录,并在index.php文件中显示一些记录,并提供指向另一个文件的链接,以显示特定行的更多记录。 我在同一个目录中有另一个名为“details.php”的文件,其中显示了所选行的完整记录 我的链接看起来像这样 <a href="details.php? name=APP_NAME">APP NAME </a> <a href="oreo"

我的公共html文件夹下有一个名为“apps”的子目录。我获取“apps”数据库表记录,并在index.php文件中显示一些记录,并提供指向另一个文件的链接,以显示特定行的更多记录。 我在同一个目录中有另一个名为“details.php”的文件,其中显示了所选行的完整记录

我的链接看起来像这样

<a href="details.php?
name=APP_NAME">APP NAME 
</a>
<a href="oreo">oreo 
</a>
https://example.com/apps/oreo
我已经尝试过这个代码,但它不起作用

RewriteRule ^/apps/(.*)$ 
/details.php?name=$1  
我对重写规则不太清楚。所以我需要帮助。

明白了。它很有效

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /apps/details.php?name=$1
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /apps/details.php?name=$1