Pass the Query string through url not by traditional method but by using mod rule in .htaccess file
/names.php?name=boy&id=23&page=1 to names/boy/23/1
RewriteEngine on
RewriteCond %{QUERY_STRING} ^name=(.+)&id=(.+)&page=(.+)$ [NC]
RewriteRule ^names\.php$ /names/%1/%2/%3? [R=301,NE,NC,L]
If you want to convert all the pages to
http://localhost/ram1/2/3
http://localhost/ram1.php?id=2&page=3
http://localhost/ram1/1
http://localhost/ram1.phppage=1
use the rewrite rule below to automatically converts to corresponding Query String
RewriteEngine on
RewriteRule ^(.+)/([0-9]+)/([0-9]+)/?$ $1.php?id=$2&page=$3 [L]
RewriteRule ^(.+)/([0-9]+)/?$ $1.php?page=$2 [L]
/names.php?name=boy&id=23&page=1 to names/boy/23/1
RewriteEngine on
RewriteCond %{QUERY_STRING} ^name=(.+)&id=(.+)&page=(.+)$ [NC]
RewriteRule ^names\.php$ /names/%1/%2/%3? [R=301,NE,NC,L]
If you want to convert all the pages to
http://localhost/ram1/2/3
http://localhost/ram1.php?id=2&page=3
http://localhost/ram1/1
http://localhost/ram1.phppage=1
use the rewrite rule below to automatically converts to corresponding Query String
RewriteEngine on
RewriteRule ^(.+)/([0-9]+)/([0-9]+)/?$ $1.php?id=$2&page=$3 [L]
RewriteRule ^(.+)/([0-9]+)/?$ $1.php?page=$2 [L]
Hi!
ReplyDeleteCould you help me?
I have a store in magento which is http://mydomain.com/store.
What I want Is to redirect/rewrite that URL to http://mydomain.com/store/highlights.
I have to do it through htaccces, because I have a custom version of magento which doesnt allow setting cmd home page for the stores.
Could you help me ? I would apreciate it very much.
Thanks
After a long research i got a way to redirect using .htaccess
ReplyDeleteRewriteEngine on
RewriteCond %{REQUEST_URI} ^/store/$
RewriteRule ^(.*)$ http://localhost/store/highlights [R,L]
put this .htaccess rule inside store folder
hi ,
ReplyDeleteour website url is like this http://mydomain.com/default/storename and i want to change it to http://mydomain.com/storename using htaccess rewrite rule i tried with many regular expression but it is not working.
Could you help me ?