: I am changing my file extensions in URLs, how to keep my good SEO results? We have a website with good SEO results. For design reasons I have to update the design and I have to change file
We have a website with good SEO results. For design reasons I have to update the design and I have to change file names from .html to .php. But I keep my domain name!
What should I do in order to keep my good SEO results?
More posts by @Debbie626
2 Comments
Sorted by latest first Latest Oldest Best
You can use one of these solutions:
Keep the Current .html extension unchanged for just frontend purpose and use Apache .htaccess file to proxify your requests so that. Add this to your .htaccess file to
work:
RewriteEngine on
RewriteRule ^(.*).html .php
OR
Why not just have the HTML pages parsed as PHP? That way you can get the best of both php and html.
AddHandler application/x-httpd-php .php .html .htm
Just redirect by 301 HTTP status all your old URLs to the new ones. If you only change file extension, you can do it easily with an .htaccess file (if you use Apache as a web server).
Put these lines in your .htaccess file:
RedirectMatch 301 (.*).html$ www.example.com.php
Of course, change example.com by your domain name.
By using 301 redirects, you lose a little bit of SEO value (PageRank) for your pages but this is the best option you have.
P.S.: like Geoff Jackson suggests in comments, if you can use URLs without file extensions, it will be a good option because you will get better user friendly URLs. The .htaccess code for this:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ .html
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.