因此,我正在尝试从以下位置缩短网址:
trel/mycompany.php?company=f4f4f4
to
trel/f4f4f4
使用下一个htaccess规则,如下例所示。最后,我可以通过在网址字段中键入trel/f4f4f4
来访问该页面,但是当我使用完整链接访问它时,它不会缩短。
我希望,我提出了一个明确的问题,使我的母语不是英语。
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^mycompany.php
RewriteRule ^([^/\.]+)/?$ mycompany.php?company=$1 [L,NC]
将.htaccess文件中的最后两行替换为下面的行
RewriteEngine开启RewriteRule ^ trel /([[^ /] *)$ /trel/mycompany.php?company=$1 [L]