Mobile app version of vmapp.org
Login or Join
Michele947

: How can I remove the .html extension for static webpages that are indexed so they'll still work in a WordPress site? I have a static HTML website with less than 100 pages and 99 of them

@Michele947

Posted in: #Htaccess #Html #Indexing #UrlRewriting #Wordpress

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?$

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Michele947

2 Comments

Sorted by latest first Latest Oldest Best

 

@Gonzalez347

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.

10% popularity Vote Up Vote Down


 

@Smith883

I believe the problem is with your regular expression

This sould work fine:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^.]+)$ .html [NC,L]

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme