-1

我的链接如下(index.php):

<a href="http://localhost/example-link.html">Example Link</a>

或者我的链接如下:

<a href="http://localhost/other.html">Other</a>

当单击链接时,我想从cat.php获取“example-link.html”ır“other.html”

猫.php

<?php 
echo $_GET["cat"];
?>

我想打印 $_GET["cat"] (example-link.html 或 other.html)

4

2 回答 2

1
RewriteEngine On
RewriteRule ^(.+)\.html$ cat\.php 

我想打印 $_GET["cat"] (example-link.html 或 other.html)

预定义的变量$_SERVER将包含一些信息,也许是REQUEST_URI

于 2012-05-27T11:30:32.973 回答
0
# Redirect old file path to new file path
Redirect /example-link.html http://localhost/cat.php
于 2012-05-27T11:31:15.703 回答