The following warnings occurred:
Warning [2] Undefined array key "threadviews_countguests" - Line: 745 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 745 errorHandler->error_callback
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined property: MyLanguage::$thread_modes - Line: 46 - File: showthread.php(1650) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1650) : eval()'d code 46 errorHandler->error_callback
/showthread.php 1650 eval




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
htaccess - how to lose the old .html suffix for new site
#1
Just wondering if any of you chaps could help out with a htaccess problem I'm having? I'm not too hot on htaccess rules so any help would be appreciated.

I'm moving a customer from a static html site over to Get Simple and I want to make sure that the changeover doesn't affect his seo rankings which are pretty darn good.

At the moment a link to a page on his site looks like this:

Code:
www.his-site.com/a-page-title-here.html

Get Simple now displays links like this (which is exactly what I want):

Code:
www.his-site.com/a-page-title-here

I have the default htaccess file which is as follows:

Code:
AddDefaultCharset UTF-8
Options -Indexes

# blocks direct access to the XML files - they hold all the data!
<Files ~ "\.xml$">
    Order allow,deny
    Deny from all
    Satisfy All
</Files>
<Files sitemap.xml>
        Order allow,deny
    Allow from all
    Satisfy All
</Files>

RewriteEngine on

# Usually it RewriteBase is just '/', but
# replace it with your subdirectory path
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule /?([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]

What would I need to add/change so that anyone who clicks on an old link from a search engine (which has .html at the end of it) will be taken to the dynamic non-.html version without throwing up an error 404 page?

I don't want to change all the pages on the site to include the .html suffix via htaccess and the custom slug option, just redirect any requests for a page ending with .html to the non-.html page.

Hope that makes sense - any help would be appreciated as htaccess always blows my mind!
Reply


Messages In This Thread
htaccess - how to lose the old .html suffix for new site - by thedoglett - 2012-08-17, 18:01:13



Users browsing this thread: 2 Guest(s)