Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Making 'subdomain.html' Look Like '/subdomain'

    Is there a way - I'm sure there is - to make it so going to for instance -

    mydomain.com/background/

    Is actually displaying -

    mydomain.com/background.html

    I don't want to put an index file in it's own folder to get the desired effect really. Is this possible with a mod_rewrite? Although I'm not quite sure how to do one lol.

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Yeah, I think you are headed in the right direction. It has been discussed before so I'd recommend searching the other server side languages/issues forum because that is where all that kind of stuff gets placed.
    OracleGuy

  • #3
    Senior Coder gsnedders's Avatar
    Join Date
    Jan 2004
    Posts
    2,340
    Thanks
    1
    Thanked 7 Times in 7 Posts
    .htaccess:
    Code:
    RewriteEngine on 
    RewriteRule (.*)$ $1.html [L]
    I think that should work

  • #4
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks!

    How weird though, I just uploaded some files to the server, eg.

    contact.html
    background.html

    But I can actually already get to them by going to

    domain.com/contact
    domain.com/background

    Perhaps the server already has that installed or something! Oh well, thanks anyway!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •