skip to Main Content

So I’m wondering how you do this with .htaccess. I have a URL that is www.websites.com/seo_packages.htm and I’d like www.websites.com/seo-packages to be what they type to get to the previous URL. I’ve done it as a 301 redirect, however it doesn’t retain the masking of /seo-packages. What’s the best way to retain the masking?

2

Answers


  1. I’m not sure what you mean by “retain the masking”, but you could create a file www.websites.com/seo-packages/index.html with the following content:

    <html>
      <head>
        <META http-equiv="refresh" content="0;URL=www.websites.com/seo_packages.htm">
      </head>
      <body>
      </body>
    </html>
    

    This will automatically redirect visitors to the new URL.

    Login or Signup to reply.
  2. You just need a single rule in your site root .htaccess:

    RewriteEngine On
    
    RewriteRule ^(seo-packages)/?$ $1.htm [L,NC]
    

    Make sure to clear your browser cache when testing it.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search