Forum Moderators: mack

Message Too Old, No Replies

changing urls to end in .php

how do i change my urls to end in .php?

         

talya

9:55 am on Nov 22, 2007 (gmt 0)

10+ Year Member



i would like to end my urls with .php but i cant seem to manage it.
im using wordpress, and i've been able to optimize them, but the last thing missing is having them with .php at the end.

i posted in different forums but no one was really able to help so i am hoping someone here might be able to assist me.

piatkow

2:51 pm on Nov 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Sorry, that doesn't seem to make a lot of sense as you wouldn't normally have to change the file type if you have created it properly.

Either the issue is something complex that you haven't explained clearly or a very simple misunderstanding on your part.

If the files are appearing in My Computer without file extensions showing then this is normally just a display issue which is corrected by using the Folder Options dialog from the Tools menu.

mack

2:00 am on Nov 28, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



The CMS that you are running is almost certainly re-writing the url's in order to shorten them and make them se friendly.

The main issue with wanting your pages to end with a file extension is that technichaly, the file doesnt exist at the url. It is being redirected to the true url...

For example the true url may be example.com/topic/t/story.php?id=6 but the url is being re-writen to example.com/article/

hope this helps.

Mack.

talya

8:14 am on Nov 28, 2007 (gmt 0)

10+ Year Member



Thank you for your reply, it was very helpful.

So according to what you're saying, the actual URL does end in php... but the SEO friendly URL is merely just a redirect.

I have to find some sort of CMS system (for quickly and easily updating content) that allows for SEO friendly URLs that I can have end in .php -- the reason for this is that the content sites will eventually be switched over into ecommerce sites using the same URL structure (and all the ecommerce site URLs end in .php - that is the format our company follows)... But if i can't get a cms that allows me to do this, i'm stuck.

Chris_Mohr

8:41 am on Nov 28, 2007 (gmt 0)

10+ Year Member



When you add an article to wordpress, it gets stored in a database. There is no actual file that gets created.

When you view the article in your web browser, the page you are looking at gets created dynamically, specifically for that request.

To me...having these urls end with ".php" sounds like kind of a strange requirement. If I were you, I would take some time to explore if this is really necessary.

If it is...then the way to add the .php is:
1. Go to yourdomain/wp-admin/options-permalink.php
2. Select Custom
3. Enter something like this for the structure: /%category%/%postname%.php

talya

9:52 am on Nov 28, 2007 (gmt 0)

10+ Year Member



Thanks again for the information.

It seems that wordpress can't create that type of URL structure (I tried what you posted).

I am just wondering if there is even a CMS system out there that can actually create the .php ending, even if the content is stored elsewhere.

The only requirement I've been given is the URL structure so that the switchover to an ecommerce site uses those same URLs (and the company's ecommerce sites only have URLs that end in .php)

Chris_Mohr

3:22 pm on Nov 28, 2007 (gmt 0)

10+ Year Member



Did the method above not work to add the ".php"? If not...what happened?
It works on my server.

talya

8:52 am on Nov 29, 2007 (gmt 0)

10+ Year Member



I can't thank you enough. It works on 'posts,' which is enough to get started. The only places it doesn't work is on 'pages' and on category URLs. The truth is I think I can manage if I create all the necessary URLs for the future ecommerce site as posts, but if you know how to add .php also to pages or categories, please let me know.