Php 将子域重定向到其他IP地址而不更改子域名称获取内部服务器错误

Php 将子域重定向到其他IP地址而不更改子域名称获取内部服务器错误,php,.htaccess,codeigniter,dns,url-redirection,Php,.htaccess,Codeigniter,Dns,Url Redirection,我想从域名/目录名/文件名/重定向到,但在URL中我想显示域名/目录名/文件名/。为此,我在.htaccess文件中编写了以下代码 RewriteEngine On RewriteCond %{HTTP_HOST} !directory_name/file_name/$ [NC] RewriteRule ^(.*)$ http://xx.xx.xx.x/project_name/controller/$1 [P] 当我写作时 RewriteEngine On Rewrite

我想从域名/目录名/文件名/重定向到,但在URL中我想显示域名/目录名/文件名/。为此,我在.htaccess文件中编写了以下代码

  RewriteEngine On
  RewriteCond %{HTTP_HOST} !directory_name/file_name/$ [NC]
  RewriteRule ^(.*)$ http://xx.xx.xx.x/project_name/controller/$1 [P]
当我写作时

  RewriteEngine On
  RewriteCond %{HTTP_HOST} !directory_name/file_name/$ [NC]
  RewriteRule ^(.*)$ http://xx.xx.xx.x/project_name/controller/$1 [L,R=301]
然后它从目录\名称/文件\名称/重定向到,但显示在URL中

为此,我将[L,R=301]更改为[p]作为站点的参考,但它给出了以下错误

 Internal Server Error

 The server encountered an internal error or misconfiguration and was unable   to complete your request.

 Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error.

 More information about this error may be available in the server error log.
请帮帮我。这将是很大的帮助。

我得到了答案。 只需启用mod_proxy_http Apache模块

  Go to your httpd.conf file and uncomment proxy_http_module
  Restart wamp
参考-