• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 210
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

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