diepnghitinh Posted October 30, 2009 Share Posted October 30, 2009 Hello, I was a student studying PHP programming language from Vietnam. Where I live, I can not find any information referring to what my question. Therefore I was looking to you to ask for help. Because my English is not good what should you expect mercy wrong understanding. I have a path to true as follows: http://localhost/shop/index.php?do=[...] ($_GET[do]) http://localhost/shop/index.php?do=[...]&cat=[...] ($_GET[do] and $_GET[cat]) PHP code as follows: <?php echo 'get show:'.$ _GET [do].' to '.$ _GET [cat]; ?> Now I are having a trouble here! Browser I want the form http://localhost/shop/test Then the browser will show that: get show: test to and when the browser is as follows: http://localhost/shop/test/12 This will show the form get show: test to 12 Problems lies in its configuration file: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?do=$1 RewriteRule ^(.*)/([0-9]+)$ index.php?do=$1&cat=$2 If I use code RewriteRule ^(.*)$ index.php?=$1 when the Browser form http://localhost/shop/test/12 show that: get show: test/12 to Not (Get show: test to 12) as you want! Who helped with Link to comment https://forums.phpfreaks.com/topic/179585-difficult-to-rewrite-the-link-htaccess-in-php/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.