开发者

Rewriting url using mod-rewrite and apache

I'm trying to add some rewriting on my site, but it seems to not work, I'm using apache and .htaccess.

The code in my .htaccess file is:

RewriteEngine On
RewriteRule ^/?os_framework/?$ /os_framework/index.php?module=home [L,NC,QSA,PT]

This should send http://localhost/os_framework/ to http://localhost/os_framework/index.php?module=home But it seems not to.

Any help would be appreciated.

In advance, thanks

Edit: Fixed the above, shouldn't have the os_frame开发者_开发问答work/ in the search pattern, however now i cant get this one to work:

RewriteRule ^/(.[^/]*)/?$ /os_framework/index.php?module=$1 [L,NC,QSA,PT]

And what is wrong with

RewriteRule ^(.[^/]*)/?$ /os_framework/index.php?module=$1 [L,NC,QSA,PT]

Why does that throw a error 500? it should work


Try this:

RewriteEngine On
RewriteRule ^os_framework/?$ os_framework/index.php?module=home [L,NC,QSA]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜