简体   繁体   中英

How Do I Set Some Pages In Wordpress To Have The .php Extension?

EDIT: SOLVED

For anyone else who may come across this issue in the future, I'm afraid the best way to do this is to setup some 302 soft re-directs. I personally preferred to use a plugin for this.

The plugin was called "404 redirected" and does the job thus far. It's not the best solution in the world but it's the easiest to implement (should you ever have a client that requires this).


I have a unique problem here. I have a client who is dead set and persisent on having SOME of her pages end in .php. However, she doesn't want all of them to end in .php. She has her reasons I guess and she's not going to budge on it.

I've tried to install a plugin called Page Extension and it worked.. somewhat. Half the time the pages saved as .php would load and half the time they wouldn't.

Does anyone have any ideas on how to accomplish this? I'm stumped.

I've found plugins that'll apparently rename the entire website to .php but she doesn't want that.

Can this even be done with a Wordpress site?

Also, I installed a plugin called NextGen Gallery to get a quick gallery up and running and it broke a lot of crap. My error_log it spammed with messages like this after installing that plugin:

"WordPress database error Table 'xxxxxxx_xxxx.wp_posts' doesn't exist for query SELECT * FROM wp_posts where post_name='php-test' made by require('wp-blog-header.php'), require_once('wp-includes/template-loader.php'), do_action('template_redirect'), call_user_func_array, wp_fake_url->check_url"

Edit: The reason she wants these .php extensions so bad is because she's running a diving company/dive shop and I guess a bunch of travel agencies have all of these links from their original site. They get around 200-300 visitors a day to some of these pages already.

Is there any way to setup some kind of re-direct so when people try to visit blah/blah.php they'll be re-directed to blah/blah?

If there's absolutely no way to only make SOME pages .php or re-direct something like that, I guess I'll have to tell her but I'll probably lose that client.

EDIT: SOLVED

For anyone else who may come across this issue in the future, I'm afraid the best way to do this is to setup some 302 soft re-directs. I personally preferred to use a plugin for this.

The plugin was called "404 redirected" and does the job thus far. It's not the best solution in the world but it's the easiest to implement (should you ever have a client that requires this).

You can use the plugin to setup whatever kind of re-direct you want.

You'll find the re-direct panel in Settings>404 Redirected Simply add your subdomain with the following extension that you want to add and people who visit that will be redirected to the regular URL

what.php will be re-directed to what/

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