Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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
Apache 协助使用重写规则_Apache_.htaccess - Fatal编程技术网

Apache 协助使用重写规则

Apache 协助使用重写规则,apache,.htaccess,Apache,.htaccess,我希望URL看起来像www.example.com/chat/91,但实际上页面是www.example.com/room.php?id=91,我在网上搜索了apache rewrite example,但我没有看到任何使用这种格式的示例,在文件中使用此RewriteRule RewriteEngine On RewriteRule ^chat/([^/]*)$ /room.php?id=$1 [L] 在测试之前,请确保清除缓存。可能的重复项您可以发布您迄今为止尝试过的内容吗?

我希望URL看起来像
www.example.com/chat/91
,但实际上页面是
www.example.com/room.php?id=91
,我在网上搜索了
apache rewrite example
,但我没有看到任何使用这种格式的示例,

文件中使用此
RewriteRule

RewriteEngine On
RewriteRule ^chat/([^/]*)$ /room.php?id=$1 [L]

在测试之前,请确保清除缓存。

可能的重复项您可以发布您迄今为止尝试过的内容吗?