catching old html files in htacess redirect
Permalink
Hi
I 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
I 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
We have this installed and set up but it doesn't re-direct the html links to the new pages unless I'm not using it correctly?
From what I've read up its a regular expression we need, I just dont have a clue how :)
From what I've read up its a regular expression we need, I just dont have a clue how :)
That block should setup the redirect for you, so it goes to the correct page when it hits your site.
If they are all simple URLs like your example you can also add about.html to the More URLs section of the Page Properties.
If they are all simple URLs like your example you can also add about.html to the More URLs section of the Page Properties.
If you really want to do it with the .htaccess I think you can use this
replacehttp://www.example.com with your URL, haven't tested this, but it should be what you are looking for.
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.
Beautiful... does exactly what I needed.
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
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
Hi hutman
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
Cheers, Matt
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
Viewing 15 lines of 19 lines. View entire code block.
Cheers, Matt
What that chunk of code does is takes any thing with a .html extension, strips the extension and redirects the page. This is ALL .html pages, including the index.html. My suggestion would be to add an alternate URL for the Home page as /index and it should redirect to /
ok if I do that i get This webpage has a redirect loop error message
Before adding that alternate URL did it get to the right place but just with /index in the URL?
Before no with yeah
http://www.concrete5.org/marketplace/addons/seo-301-redirects/...