将子域重定向到其他 IP 地址而不更改子域名获取内部服务器错误
Redirect sub domain to other IP address without changing sub domain name getting internal server error
我想从 domain_name/directory_name/file_name/ 重定向到 http://xx.xx.xx.x/project_name/controller/ 但在 URL 我想显示 domain_name/directory_name/file_name/。为此,我在 .htaccess 文件
中编写了以下代码
RewriteEngine On
RewriteCond %{HTTP_HOST} !directory_name/file_name/$ [NC]
RewriteRule ^(.*)$ http://xx.xx.xx.x/project_name/controller/ [P]
写的时候
RewriteEngine On
RewriteCond %{HTTP_HOST} !directory_name/file_name/$ [NC]
RewriteRule ^(.*)$ http://xx.xx.xx.x/project_name/controller/ [L,R=301]
然后它从 directory_name/file_name/ 重定向到 http://xx.xx.xx.x/project_name/controller/ 但在 URL 中显示 http://xx.xx.xx.x/project_name/controller/。
为此,我将 [L,R=301] 更改为 [P] 作为 http://www.inmotionhosting.com/support/website/htaccess/redirect-without-changing-url 站点的参考,但它给了我以下错误
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.
请帮忙me.It会很有帮助。
我得到了答案。
只需启用您的 mod_proxy_http Apache 模块。
Go to your httpd.conf file and uncomment proxy_http_module
Restart wamp
参考 - .htacess rewriting with the [P] proxy flag
我想从 domain_name/directory_name/file_name/ 重定向到 http://xx.xx.xx.x/project_name/controller/ 但在 URL 我想显示 domain_name/directory_name/file_name/。为此,我在 .htaccess 文件
中编写了以下代码 RewriteEngine On
RewriteCond %{HTTP_HOST} !directory_name/file_name/$ [NC]
RewriteRule ^(.*)$ http://xx.xx.xx.x/project_name/controller/ [P]
写的时候
RewriteEngine On
RewriteCond %{HTTP_HOST} !directory_name/file_name/$ [NC]
RewriteRule ^(.*)$ http://xx.xx.xx.x/project_name/controller/ [L,R=301]
然后它从 directory_name/file_name/ 重定向到 http://xx.xx.xx.x/project_name/controller/ 但在 URL 中显示 http://xx.xx.xx.x/project_name/controller/。
为此,我将 [L,R=301] 更改为 [P] 作为 http://www.inmotionhosting.com/support/website/htaccess/redirect-without-changing-url 站点的参考,但它给了我以下错误
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.
请帮忙me.It会很有帮助。
我得到了答案。 只需启用您的 mod_proxy_http Apache 模块。
Go to your httpd.conf file and uncomment proxy_http_module
Restart wamp
参考 - .htacess rewriting with the [P] proxy flag