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
1 Answer
Reset to default 0The 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
版权声明:本文标题:plugins - How page with random php file with query params generated 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742306889a2450094.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论