通配符 apache mod_rewrite
我正在尝试编写一个 mod_rewrite 来像这样
domain.com
=>;index.php
anything.anotherdomain.com
=>index.php/anything
foo.blabla.com
=>;index.php/foo
wildcard.maybeanother.com/bar/bla
=>index.php/wildcard/bar/bla
这是我的配置,但 apache 只是抛出 500 错误。
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} ^*\.*
RewriteRule ^(*\.*)$ index.php/$1/$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
有人知道这有什么问题吗? :-)
提前致谢!
I'm trying to write a mod_rewrite to work like this
domain.com
=>index.php
anything.anotherdomain.com
=>index.php/anything
foo.blabla.com
=>index.php/foo
wildcard.maybeanother.com/bar/bla
=>index.php/wildcard/bar/bla
Here is the config I have, but apache just throws a 500 error.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} ^*\.*
RewriteRule ^(*\.*)$ index.php/$1/$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
Has anybody got any idea whats wrong with this? :-)
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试一下:
Give this a try: