开发者

Apache mod-rewrite in httpd.conf not working

开发者 https://www.devze.com 2023-03-22 15:31 出处:网络
I need to make a change to my Apache web server to redirect requests for the home page from iPhone browsers to a different page. I\'ve edited the /etc/httpd/conf/httpd.conf file and added the followin

I need to make a change to my Apache web server to redirect requests for the home page from iPhone browsers to a different page. I've edited the /etc/httpd/conf/httpd.conf file and added the following:

RewriteEngine On

RewriteCond %{HTTP_USER_AGENT} .*iPhone.*
RewriteRule ^/$ /iphone/index.html [L]

After making the change, I restarted httpd, but the redirect doesn't work.

Am I missing 开发者_开发知识库something? Do the edits need to be made to a specific location in the httpd.conf file?

Other info: Server is vps hosted by Lunarpages running CentOS 5.5 and Apache 2.2.3.


For me, I use like below

RewriteEngine On

RewriteCond %{HTTP_USER_AGENT} .*iPhone.*
RewriteRule ^[\./]$ <MyDomain>/iphone/index.html [L]
0

精彩评论

暂无评论...
验证码 换一张
取 消