Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在寻找一个重新编写一个身份生成器的东西,比如
images/1-2.png
将在服务器上解释为
images/index.php?one=1&two=2
但它仍然会显示site.com/images/1-2.png在地址栏中。
site.com/images/1-2.png
假设文件名中只有一个破折号 (-)
可行吗?
这将做到这一点,将其放在应用程序根目录中的 .htaccess 文件中。
RewriteEngine on RewriteBase / RewriteRule ^images/(\d)-(\d)\.png images/index.php?one=$1&two=$2 [NC,L]