Javascript .htaccess文件夹或子文件夹中的动态Url

Javascript .htaccess文件夹或子文件夹中的动态Url,javascript,jquery,.htaccess,mod-rewrite,url-rewriting,Javascript,Jquery,.htaccess,Mod Rewrite,Url Rewriting,我在找什么 在文件夹内创建动态SEO友好URL like: exmple.com/category/product/my-heading-1 or 2 or 3 我尝试使用此代码,但它只在主页上起作用。我没有使用MySQL RewriteEngine on RewriteRule ^product/([0-9a-zA-Z]+) product.php?u=&1 [NC,L] 请将您的htaccess文件保存在类别文件夹中,并尝试执行以下规则一次。请确保在测试URL之前清

我在找什么

在文件夹内创建动态SEO友好URL

like:
exmple.com/category/product/my-heading-1 or 2 or 3


我尝试使用此代码,但它只在主页上起作用。我没有使用MySQL


RewriteEngine on

RewriteRule ^product/([0-9a-zA-Z]+)  product.php?u=&1 [NC,L]


请将您的htaccess文件保存在类别文件夹中,并尝试执行以下规则一次。请确保在测试URL之前清除浏览器缓存

也不确定为什么要提到product.php,因为它不在显示的屏幕截图中,所以请在这里的“重写规则”中提到index.php

RewriteEngine ON
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^product/([0-9a-zA-Z]+)/?$ index.php?u=&1 [NC,L]
RewriteEngine ON
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^product/([0-9a-zA-Z]+)/?$ index.php?u=&1 [NC,L]