72dpi Posted March 14, 2006 Share Posted March 14, 2006 Hi All,I am trying to do simple Search Engine Friendly URLS using Mod Reqwrite.In my .htaccess file I currently have:[code]Options +FollowSymLinksRewriteEngine onRewriteRule index/(.*)/(.*)/(.*)/(.*)/(.*)/(.*)/$ /index.php?$1=$2&$3=$4&$5=$6[/code]My a href is: [a href=\"http://www.mysite.com/index/page/a\" target=\"_blank\"]http://www.mysite.com/index/page/a[/a]Index.php is the page, and my switch content is defined as:[code]<?phpswitch ($page) {case 'a': echo "page 1"; break;case 'b': echo "page 3"; break;case 'c': echo "page 4"; break;default: echo "default";}?>[/code]Where Page is the "switch" variable, and a is the "case" I want to showThis is not working for me.My link would usually be: index.php?page=aI also want to be able to do main.php?page=a&menu=1etc.Does anyone have a good example of how to get this to work?.Every example I have found on the web has not helped me.Any pointers would be awesome! Quote Link to comment https://forums.phpfreaks.com/topic/4895-sef-urls-using-mod-rewrite-on-htaccess/ Share on other sites More sharing options...
keeB Posted March 14, 2006 Share Posted March 14, 2006 [code] <?php switch ($_GET['page']){ case 'a': print "page a"; break; } ?>[/code]works [= Quote Link to comment https://forums.phpfreaks.com/topic/4895-sef-urls-using-mod-rewrite-on-htaccess/#findComment-17278 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.