codeigniter に基づく販売スクリプトがあり、うまく機能しています
私はそのためのAPIを構築し、http://www.mysite/api/getdata経由で使用しています
したがって、 http://www.api.mysite/getdataのようなサブドメインを介してこの API にアクセスしたいと考えています 。
すべての *.mysite.com を mysite.com にリダイレクトしてから .htaccess を変更するのが解決策だと思いますが、それが本当かどうかはわかりません。
- - - - - - - - - - - - - - - - - - - - アップデート - - - - - -------------------------------
現在の .htaccess ファイル
<IfModule mod_rewrite.c>
# Check if mod_rewrite module loaded and we can work with SEO urls
SetEnv HTTP_MOD_REWRITE On
RewriteEngine on
# To redirect all users to access the site WITH the 'www.' prefix,
# (http://example.com/... will be redirected to http://www.example.com/...)
# adapt and uncomment the following:
# RewriteCond %{HTTP_HOST} ^yoursite\.com$ [NC]
# RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
#RewriteRule ^(.*)$ index.php/$1 [L]
RewriteRule ^(.*)$ ./index.php [L]
</IfModule>