Manish S
Manish S

Reputation: 111

.htaccess Dynamic Url in Folder or Subfolder

what I am looking for

Creating a dynamic SEO friendly URL inside the folder

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

enter image description here

current directory: 
exmple.com/category/
exmple.com/category/product/


I try with this code but it works only the home page. I am not using MySQL


RewriteEngine on

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

Upvotes: 0

Views: 513

Answers (1)

RavinderSingh13
RavinderSingh13

Reputation: 133670

Please keep your htaccess file in category folder and try following rules once. Please make sure you clear your browser cache before testing your URLs.

Also not sure why you are mentioning product.php its not present in your shown screen shot, so mentioning index.php in rewrite rule here.

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

Upvotes: 1

Related Questions