0

すべてのページを特定の domain/index.php または html ページにリダイレクトする方法に関するチュートリアルがたくさんあることは知っています。
しかし、私はすべてのページを ServerIP/myDirectory/ProjectName/index.php にリダイレクトする必要があり
ます。これは、クライアントとワンプを共有するオフィスで働いているためです。私のコンピューターでは、ローカルサーバーのディレクトリに移動してから、サーバーのワンプを使用する必要があります。

URL の例:http://192.168.0.100/myDirectory/ePortal/index.php

どうやってやるの?htaccessファイルにこれがあります。

RewriteBase /myDirectory/ePortal/
RewriteRule .* index.php

しかし、このhtaccessは間違っています。500 内部エラーが表示されます。

4

2 に答える 2

2

これを試すことができます:

# URLs not to redirect:
RewriteRule ^/?(captcha|My-Another-Url-Not-To-Redirect)\.php$ - [L]

# redirect all others:
RewriteRule ^/.* http://192.168.0.100/myDirectory/ePortal/index.php [L,R]

# or you may want only to redirect the homepage, then comment line above, put this:
#RewriteRule ^/index\.php http://192.168.0.100/myDirectory/ePortal/index.php [L,R]
于 2013-10-14T08:27:16.630 に答える