开发者

Rewriting url using mod-rewrite and apache

开发者 https://www.devze.com 2023-03-10 23:21 出处:网络
I\'m trying to add some rewriting on my site, but it seems to not work, I\'m using apache and .htaccess.

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

精彩评论

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