帮助基本的.htaccess的mod_rewrite [英] Help with basic .htaccess mod_rewrite

查看:221
本文介绍了帮助基本的.htaccess的mod_rewrite的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前除preting子域通配符使用PHP和我想用的.htaccess来处理它们,用户配置文件将在的 http://username.mysite.com/ (或某些人的 http://www.username.mysite.com/ )应使用/main.php?action=profile

I am currently interpreting sub-domain wild-cards with php and i would like to handle them with .htaccess, user profiles will be accessed at http://username.mysite.com/ (or for some people http://www.username.mysite.com/) which should use /main.php?action=profile

这样做的最难的部分是制作/错误/我+时许+ A +测试+消息或/files/iamatestfile.jpg去&放大器;错误= 1 +时+ A +测试+消息或放大器;文件= iamatestfile .JPG

The hardest part of this is making /error/i+am+a+test+message or /files/iamatestfile.jpg go to &error=i+am+a+test+message or &files=iamatestfile.jpg

感谢您的任何及所有的帮助!

Thanks for any and all help!

推荐答案

尝试:

 RewriteRule ^error/(.*) index.php?error=$1 [L]
 RewriteRule ^file/(.*) index.php?file=$1 [L]

......在过去的两年。

... for the last two.

这篇关于帮助基本的.htaccess的mod_rewrite的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆