Dumb SEO Questions

(Entry was posted by Atish Hemade on this post in the Dumb SEO Questions community on Facebook, 04/21/2015).

301 redirection code suggestions please

301 redirection code suggestions please.. in .htaccess file
HTML TO SHTML
www.example.com/test.html to www.example.com/test.shtml?
This question begins at 00:41:38 into the clip. Did this video clip play correctly? Watch this question on YouTube commencing at 00:41:38
Video would not load
I see YouTube error message
I see static
Video clip did not start at this question

YOUR ANSWERS

Selected answers from the Dumb SEO Questions Facebook & G+ community.

  • Atish Hemade: 301 redirection code suggestions please.. in .htaccess file
    HTML TO SHTML
    www.example.com/test.html to www.example.com/test.shtml
  • Mark Steenbakkers: +Atish Hemade why do you need the .shtml file extension? If you want to make you website user friendly, I would suggest that you remove the file extension in an url.

    Here are both options:

    RewriteEngine on
    RewriteRule ^(.*).shtml$ $1.html [nc] (rewrite .html to .shtml)
    RewriteRule ^([^.]+)$ $1.shtml [NC,L] (remove the file extension)
  • PromozSEO: I agree with +Mark Steenbakkers. You can completely remove the extension part from all your URLs with the .htaccess file.

    RewriteEngine On
    RewriteRule ^([^/.]+)$ $1.shtml [L]

    Redirect with .htaccess

    Redirect 301 /test.html http://www.example.com/test.shtml
  • Datafeedware: use this one ;RewriteEngine On RewriteRule ^([^/.]+)$ $1.shtml [L]

View original question in the Dumb SEO Questions community on Facebook, 04/21/2015).