How can I remove the .html extension for static webpages that are indexed so they'll still work in a WordPress site?
.htaccess files are extremely useful in many cases for users who either do not have root permissions or for users who simply aren't comfortable in making changes in their web server's configuration file. Trying to debug .htaccess not working isn't always the easiest thing to do, however, hopefully by checking the discuss below mentioned about html, htaccess, wordpress, search-engine-indexing, .htaccess common problems as well as the troubleshooting tips, you'll have a better grasp on what you may have to modify to get your .htaccess file running smoothly.Problem :I have a static HTML website with less than 100 pages and 99 of them are indexed in Google's search engine. I want to convert it into a WordPress website, but there are some problems I'm worried about.
My HTML website pages have an .html extension at the end of them and they're indexed with that extension, so converting those pages (even with the same content) to a WordPress page without any extension causes my whole website to be removed from Google's search.
I'm going to need to make sure that the .html extension is removed from URLs that already have just an .html extension. I want to do this using a .htaccess file. I found the following code, but it doesn't work:
^(([^/]+/)*[^/.]+).html?$
I believe the problem is with your regular expression
This sould work fine:
RewriteEngine On
RewriteCond %REQUEST_FILENAME !-f
RewriteRule ^([^.]+)$ $1.html [NC,L]
Since I helped you with the htaccess file yesterday, I need to offer some advice here:
- Do not use Jaun's rule as a workaround.
- Leave both sites up, so the HTML based site stays indexed while you
work on the WordPress Conversion. - Sign Up for Google Webmaster Tools, and add both sites to your
sitelist. - Finish the WordPress Conversion, and remove the HTML site using the
account you created in step 3. - Create a Sitemap of the new WordPress site, and submit it to Google for Re-Indexing.
- Leave the permanent redirect from yesterday and the Permalink Rewrite Rules to force all your old visitors to your new site without creating Apache overkill.
Comments
Post a Comment