Jump to content

SEF Url's using Mod rewrite on .htaccess


72dpi

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:
[code]<?php
switch ($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 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
etc.

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!
Link to comment
Share on other sites

[code] <?php

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

?>[/code]

works [=
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.