以下情况可能吗?
用户访问internet地址:www.example.com/image/123.png
123.png文件不存在-它是在输入地址时创建的,并通过imagepng输出给用户。
目前我做的是www.example.com/image/?link=123.png
我没有shell访问服务器。
Andrius
如果您的主机使用的是Apache,您可以创建一个名为"。在文档根目录(通常是"public_html"或"www"目录)中使用如下内容(未经测试):
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^image/(.*)$ image/?link=$1
您可以使用服务器的url重写(我假设您使用的是apache)将任何url映射到php脚本。这里有一些链接给你:
http://httpd.apache.org/docs/current/mod/mod_rewrite.html http://www.sitepoint.com/guide-url-rewriting/