Mod rewrite 用斜杠替换get变量
我想通过使每件事变得更简单来摆脱url栏中的id。有人能告诉我如何制作这样的/math/calculation/limits\u topic/vidname使用下面的.htaccess文件:Mod rewrite 用斜杠替换get变量,mod-rewrite,Mod Rewrite,我想通过使每件事变得更简单来摆脱url栏中的id。有人能告诉我如何制作这样的/math/calculation/limits\u topic/vidname使用下面的.htaccess文件: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php 将get方法变量传递给URL,然后将其分解 $variable
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
将get方法变量传递给URL,然后将其分解
$variables = explode("/",$_SERVER['REQUEST_URI']);
例如:
actual url : http://example.com/math.php?calculus=1&limits_topic=1&vidname=1
rewrite url : http://example.com/math/1/1/1
使用下面的.htaccess文件:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
将get方法变量传递给URL,然后将其分解
$variables = explode("/",$_SERVER['REQUEST_URI']);
例如:
actual url : http://example.com/math.php?calculus=1&limits_topic=1&vidname=1
rewrite url : http://example.com/math/1/1/1
Url重写是你最好的朋友。每个主要的web框架都可以。下一个问题。Url重写是你最好的朋友。每个主要的web框架都可以。下一个问题。