-2
例如,我有一个网站example.com,它链接到example.org中存储的文件。因此,如果用户点击下载(默认链接是www.example.org/file.zip),我想将他重定向到第三个域 - example.net。简而言之: www.example.com已链接到www.example.org,但当您单击它时,您将被重定向到example.net。这可能使用htaccess?如何使用htaccess重定向链接?
我的意思是,如果我加入www.example.com像这样的链接:到 File我想重定向example.org/file.zip www.example.net – cooher
是的,这正是.htaccess的用途。 [htaccess手册](https://httpd.apache.org/docs/current/howto/htaccess.html) – mrheroux
好吧,我知道我非常含糊,因为我的第一语言不是英语。我找到了我想要的: AddOutputFilterByType SUBSTITUTE text/html 替代s/mysite.com/sitename.com/ni 现在我需要将geoIP应用于此代码。我试图这样做: SetEnvIf之后GEOIP_COUNTRY_CODE美国LinkCountry 这里 #Substitute但它不工作。没有IfDefine的替代代码完美工作,geoIP也很好(我已经用env = LinkCountry的拒绝测试了它)。任何想法如何使用If语句? –
cooher