开发者

htaccess to remove the GET params, but still pass the value

I currently have it set to redirect www.foo.***/2 to www.foo.***/index.php?id=2, but i am trying to get it to redirect without displaying the URL.

I want the URL to stay as www.foo.***/2 but atually deliver www.foo.***/index.php?id=2

my htaccess file:

Options +FollowSymlinks
RewriteEngine ON
RewriteRule ^开发者_运维问答$ h**p://server/~user/folder/sub/index.php [L]
ErrorDocument 404 h**p://server/~user/folder/sub/ERROR/
ErrorDocument 500 h**p://server/~user/folder/sub/SERVER/
RewriteRule ^(error)/([0-9A-Za-z+]+)?$ h**p://server/~user/folder/sub/index.php?action=ERROR [L,NC]
RewriteRule ^(server)/([0-9A-Za-z+]+)?$ h**p://server/~user/folder/sub/index.php?action=SERVER [L,NC]
RewriteRule ^([0-9A-Za-z+]+)?$ h**p://server/~user/folder/sub/index.php?id=$1 [L,NC]

any help would be great thanks!

bo huttinger

thanks to awesome spamz protectionz, I subsituted stars for letters in the post


It was a 'same domain' issue. If you call a location on the same server, it doesn't rewrite the URL in the bar

solution: instead of using:

h**p://server/~user/folder/sub/index.php?id=$1 [L,NC] 

use this:

/home/~user/folder/sub/index.php?id=$1 [L,NC]

hope this helps!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜