1
Hello, all right?
I need my homepage url to look like this: http://meusite.com.br the home page url is appearing like this: http://meusite.com.br/? sourceId=78902565&categoryId=5
A second page appears as the initial: http://meusite.com.br/? sourceId=78902565&categoryId=5
I’d like the second page to look like this: http://meusite.com.br/super-ofertas ie, I would like to hide the sourceId=78902565 and on the site of categoryId=5 appeared super-offers.
On all other pages appears the sourceId=78902565, I would like to hide it in a way that does not harm my sales and in the place of categoryId appear the names of the respective categories, as:
http://meusite.com.br/? sourceId=78902565&categoryId=10 http://meusite.com.br/? sourceId=78902565&categoryId=20
I wish you’d show up:
http://meusite.com.br/celulares http://meusite.com.br/tv
My . htaccess is like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
My index.php looks like this:
<?php
function getHome(){
$url = (isset($_GET['url'])) ? $_GET['url']: ('home');
$url = array_filter(explode('/',$url));
$file = ('pgs/'.$url[0].'.php');
if(is_file($file)){
include $file;
}else{
include('pgs/'.'home'.'.php');
};
if((null== $file) || ('pgs/'.$url[0].'.php')== '' || ($_GET['url']) === false){
include('pgs/'.'404'.'.php');
exit();
};
};
getHome();
?>
Other pages like: contact and about work normally, only for the precise url(s) friendly offers page.
Is fix those weird url(s) that appear?
From now on I thank you for your help.
see if it works,
RewriteRule ^sourceId\/([0-9]{8})\/([0-9]+)\/?$ [NC] /?sourceId=$1&categoryId=$2
– Hebert Lima