简体   繁体   中英

How to Add .php extension to Category pages in Wordpress

I am hosting a Wordpress site at the Rackspace Cloud. The main site is written in ASP.NET so I have the default technology set to ASP.NET/IIS .

Php files can still be executed in this environment, however they need to end in a .php extension so the server knows how to process them.

I have found a way to add the .php extension to permalinks by just adding the .php to the end of the structure. I also have found a way to add it to any pages with this plugin, http://wordpress.org/extend/plugins/html-on-pages/ .

It appears all I have left are Category and Tag pages. For example [domain]/category/uncategorized .

I'd like to change this to /category/uncategorized/index.php or simply [domain]/category/uncategorized.php

One other thing to note, if you're not familiar with the Rackspace Cloud, I can not use a .htaccess file for this.

I would think there is somewhere I can do this within the code of Wordpress application, but I am not a php developer and have no idea where I would start.

Duke,

actually, you wont want to do that. what you really should do is setup the permalink structure so it's routed through index.php, such as domain.com/index.php/my-page/ and that way WordPress can properly capture all of the pages and posts that are supposed to be routed to WordPress.

Look here for more information: http://codex.wordpress.org/Using_Permalinks#PATHINFO:_.22Almost_Pretty.22

Duke,

I think you missed the part about using PathInfo instead of mod_rewrite, which is what it sounds like what you'll have to do.

It's tricky doing what you want to do, in the first place. You may be better off just setting it to the default permalink, and using domain.com/?p=533 so it doesn't make it links pretty at all.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM