Welcome Guest, Not a member yet? Register   Sign In
I look for perfect url rewriting for good web ranking
#1

[eluser]WebMada[/eluser]
Hello!

For a best google positioning, I avoid URL like /index.php?val= nor /actualites/news/health/1 nor actualites-1-2.html
But this third is almost good

This is the solution that I use, the non-treated URL : www.mysite.com/page-tourism-2-1

In .htaccess
Quote:#Réécriture pour les pages statiques
RewriteRule ^page-(.+)-([0-9]+)-([0-9]+)$ index.php/redirect/page/$1/$2/$3 [L,QSA]

That carries to index.php/redirect/page/$1/$2/$3. There is this specific controller (redirect) who gives the final perfect url
=> www.mysite.com/tourism

Code:
function page($KeyWord, $IdStatiqueContent, $IdMenu) {
            $_SESSION["IdMenu"] = $IdMenu;
            //Nettoyage du fichier htaccess avant de lancer une nouvelle page
            $fichier = RootPath() . ".htaccess";
            CleanFile("#[AddBegin]", $fichier );
            
            $redirection = 'RewriteRule ^' . $KeyWord .'$ ./index.php/pagestatique/pagecontent/' .$IdStatiqueContent . ' [L,QSA]';
            //Ecriture dans fichier htacces
            WriteIntoFile($redirection, $fichier);
            
            //Redirection de la page
            header("Location: ". base_url().$KeyWord);
        }

The problem is that I write in the file .htaccess! On line, many persons visit the site and sometimes, it crashes when two or more visitors visit the same link
Another solution???


Messages In This Thread
I look for perfect url rewriting for good web ranking - by El Forum - 03-15-2010, 09:57 PM
I look for perfect url rewriting for good web ranking - by El Forum - 03-16-2010, 01:29 AM
I look for perfect url rewriting for good web ranking - by El Forum - 03-16-2010, 03:08 AM
I look for perfect url rewriting for good web ranking - by El Forum - 03-16-2010, 04:31 AM
I look for perfect url rewriting for good web ranking - by El Forum - 03-16-2010, 06:09 AM
I look for perfect url rewriting for good web ranking - by El Forum - 03-16-2010, 07:11 AM
I look for perfect url rewriting for good web ranking - by El Forum - 03-27-2010, 08:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB