-1

I am using WAMP and has created a website in a 'http://localhost/snap2/html' folder. I am trying to execute following Rewrite rule but this is not working for me.

Server is giving me an error below:

The requested URL /snap2/html/browsed.html was not found on this server.

My .htaccess file is located in html folder and its structure is as below:

`RewriteEngine On

RewriteRule ^decision/([0-9]+)$ /snap2/html/decision.php?PanelID=$1`

Website is in a structure like 'www/snap2/html

Infact I am trying to rewrite following url

http://localhost/snap2/html/decision.php?PanelID=20

in to

http://localhost/snap2/html/decision/20

Also Options +FollowSymLinks gives me an error 500 therefore, I have commented it.

Any help would be pretty much appreciated.

4

3 回答 3

0

你写RewriteRule两次。尝试

RewriteRule decision/([0-9]+)$ /snap2/html/decision.php?PanelID=$1 [L, QSA]

或者

RewriteRule snap2/html/decision/([0-9]+)$ /snap2/html/decision.php?PanelID=$1 [L, QSA]
于 2012-04-10T09:05:46.387 回答
0

尝试这个:

RewriteEngine On

RewriteRule RewriteRule ^snap2/html/decision/([0-9]+)$ /snap2/html/decision.php?PanelID=$1

但我想这不是你想要的。但也许你会看到你错在哪里。

于 2012-04-10T09:06:03.393 回答
0

正则表达式中的符号^表示后面的字符串应该在 URL 的开头。所以你必须包含整个路径,有关更多示例,请参阅htaccess RewriteEngine

于 2012-04-10T09:06:19.943 回答