How Do I Set Some Pages In Wordpress To Have The .php Extension?

Discussion in 'HTML & Website Design' started by coreygeer, Aug 11, 2014.

  1. #1
    I have a unique problem here. I have a client who is dead set and persisent on having SOME of her pages end in .php. However, she doesn't want all of them to end in .php. She has her reasons I guess and she's not going to budge on it.

    I've tried to install a plugin called Page Extension and it worked.. somewhat. Half the time the pages saved as .php would load and half the time they wouldn't.

    Does anyone have any ideas on how to accomplish this? I'm stumped.

    I've found plugins that'll apparently rename the entire website to .php but she doesn't want that.

    Can this even be done with a Wordpress site?

    Also, I installed a plugin called NextGen Gallery to get a quick gallery up and running and it broke a lot of crap. My error_log it spammed with messages like this after installing that plugin:
    The reason she wants these .php extensions so bad is because she's running a diving company/dive shop and I guess a bunch of travel agencies have all of these links from their original site. They get around 200-300 visitors a day to some of these pages already.
    Is there any way to setup some kind of re-direct so when people try to visit blah/blah.php they'll be re-directed to blah/blah?

    If there's absolutely no way to only make SOME pages .php or re-direct something like that, I guess I'll have to tell her but I'll probably lose that client.
     
    coreygeer, Aug 11, 2014 IP
  2. Al3x Unlimit3d

    Al3x Unlimit3d Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #2
    its hard to understand what you are trying to do file extensions are set because of the type of file they are so it would make sense that they do not work after you change them. i imagine a re-direct would work though... why do the links have the file extension in them? none of my directories need the file extension to be viewed?
     
    Last edited: Aug 11, 2014
    Al3x Unlimit3d, Aug 11, 2014 IP
  3. coreygeer

    coreygeer Notable Member

    Messages:
    928
    Likes Received:
    310
    Best Answers:
    2
    Trophy Points:
    240
    Digital Goods:
    1
    #3
    A re-direct would work perfectly. My only question is, since those .php pages don't exist, would setting up something that sends people to .php and re-directing them to the normal url actually work?
     
    coreygeer, Aug 11, 2014 IP
  4. Al3x Unlimit3d

    Al3x Unlimit3d Peon

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #4
    create the .php file and use it to redirect
            < ?php header("Location: http://www.redirect.to.url.com/"); >
    Code (markup):

    it's amazing what google will do...
     
    Al3x Unlimit3d, Aug 11, 2014 IP
  5. coreygeer

    coreygeer Notable Member

    Messages:
    928
    Likes Received:
    310
    Best Answers:
    2
    Trophy Points:
    240
    Digital Goods:
    1
    #5
    Oh, ok, I wasn't aware something like that existed. I'll have to check that "Google" out.

    This is a Wordpress website and not setup like a standard root directory. There aren't sub-directories such as

    website.com/folder/index.php
    So while it would be easy enough if this was a standard website to just setup re-directs in individual php files, I was wondering if there was a way to do this without manually setting up those sub folders in the root directory.

    I've never had a request like this and Google doesn't provide too much information on my particular issue, hence why I came to the forums.
     
    coreygeer, Aug 11, 2014 IP
  6. coreygeer

    coreygeer Notable Member

    Messages:
    928
    Likes Received:
    310
    Best Answers:
    2
    Trophy Points:
    240
    Digital Goods:
    1
    #6
    EDIT: SOLVED

    For anyone else who may come across this issue in the future, I'm afraid the best way to do this is to setup some 302 soft re-directs. I personally preferred to use a plugin for this but if you really really want to, you can do it manually as well.

    The plugin was called "404 redirected" and does the job thus far. It's not the best solution in the world but it's the easiest to implement (should you ever have a client that requires this).
     
    coreygeer, Aug 11, 2014 IP