Hi, I am planning to move an offline .PHP static site to WordPress. I will do my best to keep my old .php URLs, but... a problem has arisen: What extensions are Wordpress pages? .PHP? Because most of the time when browsing blogs, I see no extension, but merely "/" at the end of the URL. Example - my current static .PHP pages look like this: mysite.com/thailand/trip-to-bangkok.php But blogs, which I read all lack the .php/.htm extension: blogsite/thailand/trip-to-bangkok/ Basically there's eigher a slash (/) or nothing at the end. How will it be with WordPress? Can I chose to display or not display the extension?
Yes. You can make your own decision whether to keep or not to keep the extension. However, if you choose to hide the extensions from your URL you need to make changes with the htaccess file. Here's what you need to do: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php Code (markup): Save the changes and your URL: mysite.com/thailand/trip-to-bangkok.php will appear as mysite.com/thailand/trip-to-bangkok/
WordPress allows you to choose from a handful of presets when it comes to URL formatting but you will be able to write your own, too. You can go to Settings / Permalinks from the WordPress Dashboard and set the one you like most. You can set it up to show your links in the format "yourtext.php" if you like.
Yes, this is all very useful, but I hope the above htaccess setting is not a redirect setting, just a mere "change the looks" setting.
Thank you very much for the code, I will be able to use it. But my original question is still unanswered: originally, what extensions .htm/.php are Wordpress pages? I need to know if Wordpress supports .php