我有站点,例如123.123.123.123/subdirectory/
,我想重写123.123.123.123/subdirectory/page/123
到123.123.123.123/subdirectory/page.php?id=123
。
我已经创建了.htaccess文件:
RewriteEngine On
RewriteBase /subdirectory
RewriteRule ^page/(.*)$ page.php?id=$1 [NC,L,QSA]
但它不起作用(重写)。
使用这个规则,它就会起作用。
RewriteRule ^123.123.123.123/subdirectory/page/123$ /123.123.123.123/subdirectory/page.php?id=123&%{QUERY_STRING}