[英]Rewrite URL using php code
I have experimented a lot already. 我已经尝试了很多。 I have tried every possible combination using .htaccess file however they did not work for me, so i have to put this query for which i need very specific solutions. 我尝试使用.htaccess文件进行所有可能的组合,但是它们对我不起作用,因此我必须将此查询放入需要非常具体的解决方案的地方。
No CMS is used. 不使用CMS。 The website is an eCommerce site developed using php. 该网站是使用php开发的电子商务网站。 Hosting provider is godaddy. 托管服务提供商是哥达迪。
My site url structure is 我的网站网址结构是
I want 我想要
How can i do this using php code? 我如何使用php代码做到这一点?
Maybe something like this 也许像这样
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
Options -Indexes
RewriteCond %{REQUEST_FILENAME} !-s [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^product/([0-9]+)$ product.php?product=$1 [L]
RewriteRule ^category/([a-zA-Z0-9_]+)$ category.php?category=$1 [L]
RewriteRule ^category/subcategory/([a-zA-Z0-9_]+)$ category.php?subcategory=$1 [L]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.