• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 204
  • Last Modified:

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



0
phalguni_mookhopadhayay
Asked:
phalguni_mookhopadhayay
  • 3
1 Solution
 
V4nP3rs13Commented:
try this:
RewriteRule rid/shop.php/([^/]+)/([^/]+) rid/shop.php?menu_id=$1&lang=eng=$2

and tell me if it works
0
 
V4nP3rs13Commented:
oups... my mistake

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

and tell me if it works
0
 
phalguni_mookhopadhayayAuthor Commented:
sorry,it not works.If you have any other suggestion please let me know.

thnx for your response.

0
 
V4nP3rs13Commented:
I tried on my computer.. it works. Then, your mod_rewrite is not installed/enabled on your server... check it with phpinfo(); function.
0
 
arober11Commented:
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]
0

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now