简体   繁体   English

PHP 中的多个 SEO 友好 URL

[英]Multiple SEO friendly URL in PHP

I need to make SEO-friendly Url in Core PHP in any way...我需要以任何方式在核心 PHP 中制作对 SEO 友好的 Url ...

www.example.com/product_category?cat=Men-1
to
www.example.com/product_category/Men-1
www.example.com/product_subcategory?subcat=Top Wear-12
to
www.example.com/product_subcategory/Top Wear-12
www.example.com/product?q=Men T-Shirt-1
to
www.example.com/product/Men T-Shirt-1

Please help anyone..请帮助任何人..

Please look into .htaccess file and making use of rewrites.请查看 .htaccess 文件并使用重写。

It is very confusing but you can achieve what you need.这很令人困惑,但你可以实现你所需要的。 It will take a specific url that you define such as它将采用您定义的特定 url ,例如

/product_category/something-here /product_category/something-这里

And send it to the server as并将其发送到服务器

/product_category?cat=something-here /product_category?cat=something-here

Or if you are using laravel or other similar url route system you would be able to simply alter routes.或者,如果您使用 laravel 或其他类似的 url 路线系统,您将能够简单地更改路线。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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