検討
http://localhost/MyProject/
これはルート URL です
これにアクセスするときに、URLを次のように変更したい
http://localhost/MyProject/Apps/
URLは上記のようになりますが、実行する必要があります
http://localhost/MyProject/index.php
つまり、「アプリ」という単語を URL に追加したいだけです。「Apps」という名前のフォルダがありません...
検討
http://localhost/MyProject/
これはルート URL です
これにアクセスするときに、URLを次のように変更したい
http://localhost/MyProject/Apps/
URLは上記のようになりますが、実行する必要があります
http://localhost/MyProject/index.php
つまり、「アプリ」という単語を URL に追加したいだけです。「Apps」という名前のフォルダがありません...
RewriteEngine On
RewriteCond %{HTTP_HOST} ^localhost/MyProject/index/$ [NC]
RewriteRule ^(.*)$ http:localhost/index.php [R=301,L]
これがお役に立てば幸いです...coz私は自分のローカル環境でそれを試しませんでした。
.htaccess
ファイル (MyProject
フォルダー内)に Mod_Rewrite を追加する必要があります。
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule /? Apps/ [R=301,L] # Force people to the "Apps" folder
RewriteRule Apps/?$ index.php # Make "Apps" load the index
</IfModule>