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???
#2

[eluser]WebMada[/eluser]
The problem is the management of multiusers. If many visitors visit the site at the same time, they gonna write in the .htaccess. It's why I'm searching better way
#3

[eluser]n0xie[/eluser]
Why would you go to all this trouble for something as trivial as SEO. As long as your URL's are unique, and segments of it represent keywords or properties of the content it is displaying, your site is considered SEO-friendly. What you're doing is just plain silly. You should just use Routing and Canonical links if you want your URL's to be prettier than they already are.
#4

[eluser]WebMada[/eluser]
So, an URL like that www.mysite.com/actualites-page-2-5-9 is OK. I've rewritten all my URL like that instead of content/actualites/page/2/5/9

But someone said me that the best for SEO is like www.mysite.com/actualites

Who's right and who's wrong?
#5

[eluser]n0xie[/eluser]
Like I said you can just use routing:
Code:
$route['actualites'] = "content/actualites/page/2/5/9";

Now www.mysite.com/actualites will map to www.mysite.com/content/actualites/page/2/5/9
#6

[eluser]WebMada[/eluser]
routes.php isn't good for me because there are content/actualites/page/2/5/9, content/actualites/page/2/5/10, content/actualites/page/1/5/9 etc !!!

That's why I did that I did in my first message

My URLs are already like /page-risk-rating-16-2, /page-mining-6-3
And it becomes /risk-rating /mining easy to SEO

But there is conflict when writing in .htaccess sometimes
#7

[eluser]lenwood[/eluser]
The structure of your URL is pretty far down in the list of importance for search ranking factors. Page titles, header tags (h1, h2, etc) and the anchor text of your internal links are all MUCH more important. As long as the keywords you're targeting appear somewhere within the URL you'll be fine.

Suppose you want to rank well for the search term "denver pizza". All other things being equal,

Code:
example.com/colorado/restaurants/archive/pizza/24/denver/public

would get you to exactly the same search ranking as

Code:
example.com/denver/restaurants/pizza

Also, if you're doing URL routing you want to ensure that your server only responds to one version of the URL, otherwise you're opening up the possibility for duplicate content which will negate the value.




Theme © iAndrew 2016 - Forum software by © MyBB