Http 如何在apache配置中为文件名使用通配符别名?
调用以下URL时,我需要apache调用file.php:Http 如何在apache配置中为文件名使用通配符别名?,http,apache2,apache,httpd.conf,Http,Apache2,Apache,Httpd.conf,调用以下URL时,我需要apache调用file.php: /file.xml /file-contents.xml /file-abc.xml /file-n.xml /file-xyz.xml 下面是我的apacheconf文件中的一个示例:(倒数第二行是关键行) AliasMatch允许对这类事情使用正则表达式:AliasMatch允许对这类事情使用正则表达式: <VirtualHost *:80> DocumentRoot /html ServerName
- /file.xml
- /file-contents.xml
- /file-abc.xml
- /file-n.xml
- /file-xyz.xml
AliasMatch
允许对这类事情使用正则表达式:AliasMatch
允许对这类事情使用正则表达式:
<VirtualHost *:80>
DocumentRoot /html
ServerName domain.com
UseCanonicalName Off
Alias /file.xml /html/file.php
Alias /file-contents.xml /html/file.php
Alias /file-*.xml /html/file.php
</VirtualHost>
AliasMatch ^/file-(.*).xml /html/file.php