1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Mod_rewrite / htaccess questions..

Discussion in 'HTML, Graphics & Programming' started by Westyfield2, 2 Jun 2010.

  1. Westyfield2

    Capodecina

    Joined: 14 Dec 2005

    Posts: 12,494

    Location: Bath

    Hi guys,

    I'm not really sure whether it's done through mod_rewrite or htaccess, and either way I'm not really sure how to do it!

    Right now on a website I've got www.domain.com/page_name.php, and any links or whatever to that page use that URL. That page is just on the main root, not in a lower down folder or anything. What I'd like is to be able to give people the address www.domain.com/word and them to be taken to www.domain.com/page_name.php. I don't really mind whether their browser address stays as www.domain.com/word or displays www.domain.com/page_name.php.

    I'm sure to someone that knows what they're doing this is simple enough, but I've never done it before! I've heard of mod_rewrite, and I've used htaccess for password protection & custom error pages, but never done this before.


    Cheers,
     
  2. Westyfield2

    Capodecina

    Joined: 14 Dec 2005

    Posts: 12,494

    Location: Bath

    Worked it out :D

    Added this to my .htaccess

    So going to www.domain.com/word gives the user www.domain.com/page_name.php :D