Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.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 编写htaccess重写规则_Apache_.htaccess_Mod Rewrite_Url Rewriting_Friendly Url - Fatal编程技术网

Apache 编写htaccess重写规则

Apache 编写htaccess重写规则,apache,.htaccess,mod-rewrite,url-rewriting,friendly-url,Apache,.htaccess,Mod Rewrite,Url Rewriting,Friendly Url,我需要帮助来制定这个htaccess重写规则 假设我有这个url 我需要使代码和通道号可变 到目前为止,我尝试了这个没有运气,但它一直给我没有找到页面 RewriteEngine On RewriteBase / RewriteRule ^/live/(.*)/(.*)?$ /new.php?code=$1&channel=$2 对不起,我是初学者。任何努力都是值得赞赏的。再次感谢请您尝试以下内容,并用展示的样品进行书写和测试。请确保在测试URL之前清除浏览器缓存 RewriteEng

我需要帮助来制定这个htaccess重写规则

假设我有这个url

我需要使代码和通道号可变

到目前为止,我尝试了这个没有运气,但它一直给我没有找到页面

RewriteEngine On
RewriteBase /
RewriteRule ^/live/(.*)/(.*)?$ /new.php?code=$1&channel=$2

对不起,我是初学者。任何努力都是值得赞赏的。再次感谢

请您尝试以下内容,并用展示的样品进行书写和测试。请确保在测试URL之前清除浏览器缓存

RewriteEngine ON
RewriteRule ^live/([^/]*)/([^.]*)\.m3u8/?$ new.php?code=$1&channel=$2 [NC,L]

new.php在哪里?Thanks@AhmedIbrahim,
我要去http://test.com/live/6789767897879/1432.m3u8 其中代码和频道号是可变的
我应该问你:)你在问题中没有提到。它到底应该在哪里?请务必提及。感谢您的回复,这是默认apache目录中的/var/www/html。它位于.htaccess的同一目录中file@AhmedIbrahim,请您现在试用我编辑的代码,让我知道它是如何运行的?工作起来很有魅力。你是最棒的!