我安装了WordPress。我在这个路径上有一个图像:
http://www.somedomain.com/wp-content/themes/twentytwelve/image.php
是否可以将其链接/重写到此路径?
http://www.somedomain.com/wp-content/themes/twentytwelve/image.png
Htaccess可能很好。可能匹配/image.php
?
在.htaccess文件中尝试此操作:
RewriteEngine On
RewriteRule ^(.*)'.php$ $1.png
您可以尝试以下操作:
Options +FollowSymlinks -MultiViews
RewriteEngine on
RewriteRule ^(script)/([^.]*)'.php$ $1/image.png [L]
希望它能帮助你实现你想要的。请原谅我的语法错误。