Page 1 of 1

How to use only one url for a site ---(SEF URLS)

Posted: Mon Feb 15, 2010 6:47 pm
by arjuninfo
How to use only one url for a site?

Here is an fix for that ...

IF a user turn on the SEF ,he can use the both SEF and Non Sef URL
------------------------------------------------------------
example

sef url : www.examplesite.com/arjun.html (article id=20)

non sef url : http://www.examplete.com/option=com_con ... Itemid=216

------------------------------------------------------------

when a user types the non sef url,it should not go the article page,it will redirects to index page or 404 page ...

For that u need to add a small code in the top of templates/templatename/index.php

<?php
$url_array = explode("option=com_content&view=article",$_SERVER['REQUEST_URI']);
if(count($url_array) > 1) {
header('Location:index.php');
}
?>