Jump to content


This topic is now archived and is closed to further replies.


SEF Url's using Mod rewrite on .htaccess

Recommended Posts

Hi All,
I am trying to do simple Search Engine Friendly URLS using Mod Reqwrite.
In my .htaccess file I currently have:
[code]Options +FollowSymLinks
RewriteEngine on
RewriteRule 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:
switch ($page) {
case 'a':
   echo "page 1";
case 'b':
   echo "page 3";
case 'c':
   echo "page 4";
   echo "default";

Where Page is the "switch" variable, and a is the "case" I want to show

This is not working for me.

My link would usually be: index.php?page=a
I also want to be able to do main.php?page=a&menu=1

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!

Share this post

Link to post
Share on other sites
[code] <?php

    switch ($_GET['page']){
        case 'a':
            print "page a";


works [=

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.