1

I've built 2 sites on Wordpress. In both of them, I did two things:

  1. Created a slug for each page.
  2. In Settings > Permalink Settings, I chose "Custom Structure", and entered /%postname%.php

In one site, Wordpress gives me exactly what I want: the url of each page is the slug plus the .php extension.

In the other site, the url is just the slug and Wordpress suppresses the .php extension! If I explicitly type in the url with .php into my browser address line, it redirects to the page without the .php! Even when I'm editing the page in Wordpress, it shows near the top of the screen, just below the page title, the permalink without the php extension.

I can't understand why the first site works as desired and wordpress retains the .php extension, while in the second, wordpress discards the php extension!

  • Might be your .htaccess file - is there a rewrite in there causing this? – Pat Gilmour Jun 24 '14 at 14:16
  • The site that is causing problems has no .htaccess files whatsoever. – oyvey Jun 30 '14 at 8:56
  • Find a solution? Bear in mind .htaccess files are hidden by default and sometimes stored higher than your site in the server directories. – Pat Gilmour Aug 1 '14 at 2:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.