Link to home
Start Free TrialLog in
Avatar of phalguni_mookhopadhayay
phalguni_mookhopadhayay

asked on

mod_rewrite

hi,

i want to show the  url -http://rid-international.de/rid/shop.php?menu_id=19&lang=eng   to

-http://rid-international.de/rid/shop.php/19/eng




what should be the rewrite rule?

i try the following rules but does not work.please  let me know if you have any suggession .
RewriteEngine on
RewriteBase /
RewriteRule ^([^/]+)/([^/]+)/([^/]+)?$ shop.php?lang=$2&menu_id=$1 [nc]




with thanks & regards,
Arundhuti



Avatar of V4nP3rs13
V4nP3rs13
Flag of Bosnia and Herzegovina image

try this:
RewriteRule rid/shop.php/([^/]+)/([^/]+) rid/shop.php?menu_id=$1&lang=eng=$2

and tell me if it works
oups... my mistake

TRY THIS ONE:
RewriteRule rid/shop.php/([^/]+)/([^/]+) rid/shop.php?menu_id=$1&lang=$2

and tell me if it works
Avatar of phalguni_mookhopadhayay
phalguni_mookhopadhayay

ASKER

sorry,it not works.If you have any other suggestion please let me know.

thnx for your response.

ASKER CERTIFIED SOLUTION
Avatar of V4nP3rs13
V4nP3rs13
Flag of Bosnia and Herzegovina image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of arober11
1) Are you loading mod_rewrite in your httpd.con, or included .conf file e.g.

LoadModule rewrite_module          xxxxxxxxxxxx/mod_rewrite.so

2) Where are you adding the rules: in the apache  httpd.conf  or a .htaccess file?

a) If the httpd.cont, then the following in the appropriate Virtualhost definition should do:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/rid/shop.php/([^/]*)/([^/]*)[/]*   /rid/shop.php?menu_id=$1&lang=$2  [L]

b) If a .htaccess  you must have  an "AllowOverride" line in you httpd.conf, to allow the use of .htaccess files, along with a suitable option to the command e.g. all

c) Which directories .htaccess are you placing the rules in?

If it's the root, then the following may work:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^rid/shop.php/([^/]*)/([^/]*)[/]*   /rid/shop.php?menu_id=$1&lang=$2  [L]