开发者

My mod_rewrite rule is wrong, I can't seem to figure out how to write it to work for me

Here is my current .htaccess file: (it is running on my personal WAMP server. And Mod_Rewrite is enable on my server.)

<IfModule mod_rewrite.c>
   Options +FollowSymLinks
   Options +Indexes
   RewriteEngine On
   RewriteBase /rdypages/

   RewriteCond %{SCRIPT_FILENAME} !-f
   RewriteCon开发者_开发百科d %{SCRIPT_FILENAME} !-d
   RewriteRule ^(.*)$ /rdypages/index.php?company=$1&page=$2
</IfModule>

My /rdypages/index.php file is design to look for the following parameters in the quesystring: company and page. Here is an example address:

http://localhost:8888/rdypages/index.php?company=test&page=test.htm

and this is what I would like it to look like:

http://localhost:8888/rdypages/test/test.htm

What should my .htaccess file's RewriteRule say? Thanks


i figured it out:

RewriteRule ^(.*)/(.*)$ /rdypages/index.php?company=$1&page=$2

I have tested it and it works fine!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜