mod rewrite with htaccess
I am trying to write a htaccess file with mod rewrite but no luck.
The original url is
http://www.bpages.com/beta/index.php?option=com_sobi2&sobi2Task=sobi2Details&catid=1770&sobi2Id=94872&Itemid=
I want the new url s开发者_开发百科hould be
http://www.bpages.com/beta/abc/xyz
catid=1770
refers to abc
,
sobi2Id=94872
refers to xyz
,
beta
is a sub directory
Is it possible.Please suggest the best possible way.
Thanks in advance,
Prithvi
The following should do what you want, though I haven't tested it. Also... the Itemid part is empty. Was that just a mistake, or is it supposed to be empty?
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^beta/([^/]+)/(.+)$ beta/index.php?option=com_sobi2&sobi2Task=sobi2Details&catid=$1&sobi2Id=$2&Itemid= [NC]
</IfModule>
If I understood your question correctly then these rules should work:
Options +FollowSymlinks -MultiViews
RewriteEngine on
RewriteCond %{QUERY_STRING} catid=([^&]+)&sobi2Id=([^&]+)& [NC]
RewriteRule ^(beta/.*)$ /$1/%1/%2? [L,R,NC]
精彩评论