hamza Posted April 23, 2010 Share Posted April 23, 2010 if my url rewirte not working then where should i see the error messages. please tel me the way to place where i can see the not working url rewrite message. so i can debug it. Quote Link to comment https://forums.phpfreaks.com/topic/199480-urlrewrite-errors-location/ Share on other sites More sharing options...
cags Posted April 23, 2010 Share Posted April 23, 2010 Define URL rewrite. Do you mean using RewriteRules in a .htaccess file? Quote Link to comment https://forums.phpfreaks.com/topic/199480-urlrewrite-errors-location/#findComment-1046949 Share on other sites More sharing options...
hamza Posted April 23, 2010 Author Share Posted April 23, 2010 i have page name 1.php which contain this anchor <a href="seepagenumber-1-2.html">redirect</a> 1 this mean in anchor that i am redirect to google  page name 2.php switch ($_GET['v']) { case '1': header('Location: www.google.com'); break;  case '2': header('Location: www.hotmail.com'); break;  default: break; } my rewrite rules is Options +FollowSymLinks RewriteEngine on RewritRule ^seepagenumber-(.*)-2.html$ 2.php?v=$1  this is not working plz help me  Quote Link to comment https://forums.phpfreaks.com/topic/199480-urlrewrite-errors-location/#findComment-1046994 Share on other sites More sharing options...
cags Posted April 23, 2010 Share Posted April 23, 2010 The easiest way to debug is normally to add the [R] flag so that the URL actually get's redirected so you can see in the browser what address it's actually looking at. Â RewritRule ^seepagenumber-(.*)-2.html$ 2.php?v=$1 [R] Â You may be having problems if your using Chrome (or potentially other browsers) with caching, I've generally found Firefox the best browser to avoid caching issues. Quote Link to comment https://forums.phpfreaks.com/topic/199480-urlrewrite-errors-location/#findComment-1047009 Share on other sites More sharing options...
hamza Posted April 23, 2010 Author Share Posted April 23, 2010 http://localhost/a/seepagenumber-2-2.html NOT FOUND ERROR Â Â Options +FollowSymlinks # for security but be enable RewriteEngine on RewritRule ^seepagenumber-(.*)-2.html$ 2.php?v=$1 [R] Â Â Â 2.php <a href="seepagenumber-2-2.html">redirect</a> Â Â Â Quote Link to comment https://forums.phpfreaks.com/topic/199480-urlrewrite-errors-location/#findComment-1047019 Share on other sites More sharing options...
cags Posted April 23, 2010 Share Posted April 23, 2010 What URL do you see in the address bar? Is it correct? Quote Link to comment https://forums.phpfreaks.com/topic/199480-urlrewrite-errors-location/#findComment-1047020 Share on other sites More sharing options...
hamza Posted April 23, 2010 Author Share Posted April 23, 2010 What URL do you see in the address bar? Is it correct? this one http://localhost/a/seepagenumber-2-2.html Quote Link to comment https://forums.phpfreaks.com/topic/199480-urlrewrite-errors-location/#findComment-1047030 Share on other sites More sharing options...
cags Posted April 23, 2010 Share Posted April 23, 2010 You spelt RewriteRule wrong. Quote Link to comment https://forums.phpfreaks.com/topic/199480-urlrewrite-errors-location/#findComment-1047039 Share on other sites More sharing options...
hamza Posted April 23, 2010 Author Share Posted April 23, 2010 You spelt RewriteRule wrong. then plz guide me how i split. Quote Link to comment https://forums.phpfreaks.com/topic/199480-urlrewrite-errors-location/#findComment-1047046 Share on other sites More sharing options...
cags Posted April 23, 2010 Share Posted April 23, 2010 Oddly enough it's spelt how I spelt it. The word Rewrite is spelt how you spelt it in RewriteEngine, i.e. it ends with an e. Quote Link to comment https://forums.phpfreaks.com/topic/199480-urlrewrite-errors-location/#findComment-1047052 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.