admin管理员组

文章数量:1332377

I am using this platform to know more about a trend of publishing articles in Wordpress in a specific pattern. Today I encountered a site with the following URL: eg: www.xyz_sitename/site/random_php_filename.php?some_key=slug-of-an-article The site is created in Wordpress and I am very much curious to know how these kinds of pages are generated in Wordpress.

Is there some kind of plugin responsible for this or custom work?

I researched to figure this out, but no luck. Can anyone help me to understand this technique of presenting articles in a single PHP file with varying query params?

Example: .php?3ffb60=citroen-c1-used-cars-for-sale-in-north-west

I am using this platform to know more about a trend of publishing articles in Wordpress in a specific pattern. Today I encountered a site with the following URL: eg: www.xyz_sitename/site/random_php_filename.php?some_key=slug-of-an-article The site is created in Wordpress and I am very much curious to know how these kinds of pages are generated in Wordpress.

Is there some kind of plugin responsible for this or custom work?

I researched to figure this out, but no luck. Can anyone help me to understand this technique of presenting articles in a single PHP file with varying query params?

Example: http://www.meganjoy.ca/site/ui492i7.php?3ffb60=citroen-c1-used-cars-for-sale-in-north-west

Share Improve this question asked Jun 30, 2020 at 7:00 NinjaMANNinjaMAN 1031 silver badge3 bronze badges 1
  • Editing your question to include a specific example of a URL you'd like to make and where it should go in regular Wordpress URL's will allow a more specific answer – mozboz Commented Jun 30, 2020 at 9:32
Add a comment  | 

1 Answer 1

Reset to default 0

The site you linked isn't a Wordpress.

You can make custom Wordpress URL's using Wordpress's URL Rewrite API. See https://codex.wordpress/Rewrite_API/add_rewrite_rule#Example , e.g.:

function custom_rewrite_basic() {
  add_rewrite_rule('^anythinghere/([0-9]+)/?', 'index.php?page_id=$matches[1]', 'top');
}
add_action('init', 'custom_rewrite_basic');

This makes a new URL format like yoursite/anythinghere/95

If that doesn't meet your needs you can also edit .htaccess

Editing your question to include a specific example of a URL you'd like to make and where it should go in regular Wordpress URL's will allow a more specific answer. For example, your question could include a format of a URL you want: e.g.: yoursite/foo/bar/hello.php?id=1234567 and a description of where you want the URL to go: "I want this URL to go to post ID 1234567"

本文标签: pluginsHow page with random php file with query params generated