catching old html files in htacess redirect
PermalinkI have moved from an old site which was HTML based to C5.
Is there a way I can catch the old html urls and links so /about.html redirects to the new /about page.
Seen its do-able in htacess file but not sure how.
Any help would be massively appreciated
Thanks, Matt
From what I've read up its a regular expression we need, I just dont have a clue how :)
If they are all simple URLs like your example you can also add about.html to the More URLs section of the Page Properties.
RedirectMatch 301 (.*)\.html$ http://www.example.com$1
replacehttp://www.example.com with your URL, haven't tested this, but it should be what you are looking for.
Also thanks for the page paths thing, I never thought to add .html into there
Thanks a lot hutman :)
This is why I love the C5 community
The propblem seemed to have sorted out the internal pages but when you go to the homepage it was putting on /index
Any ideas why? Heres my htaccess code
# -- concrete5 urls start -- <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME}/index.html !-f RewriteCond %{REQUEST_FILENAME}/index.php !-f RewriteRule . index.php [L] </IfModule> # -- concrete5 urls end -- RedirectMatch 301 (.*)\.html$ http://www.saloukee.com$1 #Compression routines SetOutputFilter DEFLATE AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/x-js text/x-javascript application/x-javascript BrowserMatch ^Mozilla/4 gzip-only-text/html
Cheers, Matt
http://www.concrete5.org/marketplace/addons/seo-301-redirects/...