Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!



Photo
- - - - -

Question About Htm And Html


  • Please log in to reply
5 replies to this topic

#1 Marchy

Marchy

    HR 4

  • Active Members
  • PipPipPipPip
  • 248 posts
  • Location:Canada

Posted 26 October 2009 - 09:26 AM

I am switching a site with Joomla. All my files extensions are htm and joomla makes the extension html by default. I do not want to redirect all of them for that. I am wondering if there is anything I can put in the htaccess to avoid that.

#2 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 26 October 2009 - 09:43 AM

I'm confused by what you're trying to do exactly Marchy.

Are you wanting to change the way Joomla works so that it uses .htm instead of .html extensions? If so, that's going to take a change in how Joomla is configured. Which is probably going to mean an extension that rewrites the urls.

Where I'm a bit confused is this. I can't fathom how Joomla would be using the exact same urls as your previous non-Joomla pages would carry. So one way or another you'd end up either redirecting those old urls or simply letting them 404 and hope the new urls got picked up.

#3 Marchy

Marchy

    HR 4

  • Active Members
  • PipPipPipPip
  • 248 posts
  • Location:Canada

Posted 26 October 2009 - 10:20 AM

QUOTE(Randy @ Oct 26 2009, 10:43 AM) View Post
I'm confused by what you're trying to do exactly Marchy.

Are you wanting to change the way Joomla works so that it uses .htm instead of .html extensions? If so, that's going to take a change in how Joomla is configured. Which is probably going to mean an extension that rewrites the urls.

Where I'm a bit confused is this. I can't fathom how Joomla would be using the exact same urls as your previous non-Joomla pages would carry. So one way or another you'd end up either redirecting those old urls or simply letting them 404 and hope the new urls got picked up.

I am not trying to change how Joomla works. You can put an alias in the link in the menu item. let's say " example-canada" and then Joomla name the url www.example.com/example-canada.html. I can use my exisitng website name of files but my pages are .htm so when I put them in the alias it will transfer to html. I was wondering if there is a code in the htaccess file I can put to say that htm is html or do I need to redirect them all because one is htm and the other one is html? I want to keep the value of these pages.

#4 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 26 October 2009 - 10:56 AM

So there will be no more .htm extension pages then? They'll all be redirected to .html extension pages? That should be pretty simple to accomplish, assuming of course you're on a *nix server with mod_rewrite enabled. A single line to mass redirect all .htm pages will do the trick as long as there will be no .htm extension pages anymore.

CODE
RewriteRule ^(.*).htm$ /$1.html [R=301,L]


#5 Marchy

Marchy

    HR 4

  • Active Members
  • PipPipPipPip
  • 248 posts
  • Location:Canada

Posted 26 October 2009 - 02:19 PM

QUOTE(Randy @ Oct 26 2009, 11:56 AM) View Post
So there will be no more .htm extension pages then? They'll all be redirected to .html extension pages? That should be pretty simple to accomplish, assuming of course you're on a *nix server with mod_rewrite enabled. A single line to mass redirect all .htm pages will do the trick as long as there will be no .htm extension pages anymore.

CODE
RewriteRule ^(.*).htm$ /$1.html [R=301,L]

They won't be anymore htm. So that does the same thing as doing redirection one by one with a redirection 301?

#6 Randy

Randy

    Convert Me!

  • Moderator
  • 17,540 posts

Posted 26 October 2009 - 02:29 PM

QUOTE
So that does the same thing as doing redirection one by one with a redirection 301?


Yup, it does.

What it says in something resembling English is:

Hey server! Listen up, this is important.

If anyone or anything requests a file of any name at any location on my site that ends with the text string .htm please automatically redirect them to a file at the same path and same filename, except give it a .html extension. And while you're doing the redirect please also send them a 301 Moved Permanently status code.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

SPAM FREE FORUM!
 
If you are just registering to spam,
don't bother. You will be wasting your
time as your spam will never see the
light of day!