Php 没有htaccess的短链接如何?

Php 没有htaccess的短链接如何?,php,.htaccess,Php,.htaccess,嘿,我的朋友们,我是htaccess的noob,我需要你们的帮助:) 这是我的htaccess文件: Options +FollowSymLinks RewriteEngine on RewriteRule pro/(.*)/(.*)$ index.php?site=$1&cat=$2 RewriteRule go/(.*)/(.*)$ index.php?site=$1&cat=$2 RewriteRule goto/(.*)/(.*)$ index.php?site=$1&a

嘿,我的朋友们,我是htaccess的noob,我需要你们的帮助:)

这是我的htaccess文件:

Options +FollowSymLinks
RewriteEngine on
RewriteRule pro/(.*)/(.*)$ index.php?site=$1&cat=$2
RewriteRule go/(.*)/(.*)$ index.php?site=$1&cat=$2
RewriteRule goto/(.*)/(.*)$ index.php?site=$1&cat=$2
RewriteRule buying/(.*)/(.*)$ index.php?site=$1&cat=$2
RewriteRule pay index.php?site=pay
RewriteRule delivery index.php?site=delivery
RewriteRule faq index.php?site=faq
RewriteRule contact index.php?site=contact
RewriteRule replace index.php?site=replace
我当前的产品链接是:

http://localhost/pro/id/keys
http://localhost/pro/id/voucher
http://localhost/pro/id/tools
是否可以将我的链接设置为?:

http://localhost/keys.exe
http://localhost/voucher.exe
http://localhost/tools.exe
Or without .exe at the end ?
我的英语很差,我希望你们中的任何人都能帮助我解决我的问题:(

一位用户告诉我: 替换此规则:

RewriteRule pro/(.*)/(.*)$ index.php?site=$1&cat=$2

with

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/.]+)\.exe$ /index.php?site=id&cat=$1 [L,QSA]

但它不起作用

这个问题与PHP无关。您处理请求的脚本是PHP,但问题纯粹是关于.htaccess的。这是一个正确的假设吗?有了这个假设,我又想到了另一个关键问题。ID会发生什么变化?在produkt链接中,您包含产品ID。在简短的URL中,您不需要它们?