WordPress.org

Ready to get started?Download WordPress

Forums

Automatically appending ".php" to the end of the permalinks... (6 posts)

  1. energyco
    Member
    Posted 6 years ago #

    Hello,

    I've tried following the instructions for "Having your posts end in .html" under the "Using Permalinks" documentation, but it's not giving me the result that I need.

    Sure it works when I go to a page such as "http://www.site.com/page.php," but it looks like it just redirects the page to "http://www.site.com/page," which doesn't work out for me.

    Is there any way that I can hack it so it REALLY emulates a .php extension, instead of it just redirecting?

    The reason I need this is because I'm converting a site with a good page rank over to WordPress, and I want to confuse the search engines as little as possible.

    Thank you!

  2. moshu
    Member
    Posted 6 years ago #

    As far as I know it works only for posts, not for Pages.

  3. energyco
    Member
    Posted 6 years ago #

    I know that I can modify the .htaccess file to make up rules to automatically append the .php, but there is one big problem with that, and that's that I would have to use static or at least staticish links in my WordPress installation, instead of sweet php link codes like get_permalink(26);. And there's a WHOLE lot of them I'd have to change. :(

    I have no problem writing up a long .htaccess file to get the links to do what I want, but is there anyone that knows how I can edit the "get_permalink" function to get the correct link (ie http://www.site.com/page.php instead of http://www.site.com/?page_id=10 or http://www.site.com/parent/page/)?

    The code doesn't have to be pretty, I just can't think of any way to get it to do what I want.

    Any help is super appreciated!

  4. skipcollege
    Member
    Posted 6 years ago #

    Hello, I'm looking for this solution as well. Any luck in finding a working solution for this yet?

    Thanks

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    Search Engines don't care about the extensions. Really. Having one extension or another will not change your pagerank one bit.

  6. Cailean
    Member
    Posted 6 years ago #

    just make sure you have 301 redirects in your .htaccess from the /oldpage.php to /newpage

    That will ensure that your PR follows to the new pages.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.