httpd.conf または vhosts.conf を編集するためのアクセスを許可しない新しいホストに移動するので、代わりに .htaccess を使用する必要があります。
これが私の既存の仮想ホストconfです:
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.dev
DocumentRoot /path/to/html
Alias /sitemap.xml /path/to/html/sitemap.php
Alias /sitemap.xml.gz /path/to/html/sitemap.php
AliasMatch ^/sitemap(.*).xml /path/to/html/sitemap.php
AliasMatch ^/sitemap(.*).xml.gz /path/to/html/sitemap.php
Alias /robots.txt /path/to/html/robots.php
AliasMatch ^/robots.txt /path/to/html/robots.php
<Directory /path/to/html>
AllowOverride none
Options all
Order allow,deny
Allow from all
Deny from none
<IfModule mod_rewrite.c>
Options +FollowSymLinks -MultiViews
RewriteEngine On
# The following redirects all directories to root using PATH variables
# Ex. /abc/def/ redirects to /index.php/abc/def/
RewriteCond %{REQUEST_URI} !=/server-status
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php/$1 [L]
</IfModule>
</Directory>
</VirtualHost>
目標は、htaccess を使用して同じ対話を取得することです。
私が探している主な相互作用は次のとおりです。
sitemap.xml => sitemap.php
sitemap-abc.xml => sitemap.php
sitemap-___.xml => sitemap.php
sitemap-xyz.xml => sitemap.php
robots.txt => robots.php
/abc/def/ => /index.php/abc/def/
上記の vhosts.conf は私の古いホストでは問題なく動作しますが、htaccess のみを使用して新しいホストでこれを実行する方法がわかりません。