Jump to content

Isolate One Link hor htaccess Affect?


justlukeyou

Recommended Posts

Hi,

 

I have fixed one problem only to make another one.

 

I have added a piece of code to my htaccess file which allows me to add the product title to the link for SEO purposes=

 

.com/123456/large-red-widget

 

However it now affects all the other links which have a query in. Can anyone advise how I can just isolate products/product to have a second variable after the one which operates the query?

 

 

  RewriteRule ^products/product/([0-9]+)/(.*)$ products/product.php?product_id=$1 [QSA,L]
RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^([a-z]+)/([a-z\-]+)$ /$1/$2.php [QSA,L]
  RewriteRule ^products/product/([0-9]+)/(.*)$ products/product.php?product_id=$1 [QSA,L]
  RewriteRule ^articles/article/([0-9]+)/(.*)$ articles/article.php?ID=$1 [QSA,L]
    RewriteRule ^articles/articlesfiltered/([A-Za-z]+)/(.*)$ articles/articlesfiltered.php?articlecategory=$1 [QSA,L]
  RewriteRule ^plusstyle/plusstyle/([0-9]+)/(.*)$ plusstyle/plusstyle.php?ID=$1 [QSA,L]
   RewriteRule ^plusstyle/plusstylesfiltered/([A-Za-z]+)/(.*)$ plusstyle/plusstylesfiltered.php?articlecategory=$1 [QSA,L]
Link to comment
https://forums.phpfreaks.com/topic/280153-isolate-one-link-hor-htaccess-affect/
Share on other sites

Thanks,

 

I have tried that but it has had no impact. Is it possible only affect how the products link works as this is the only page I want to have a slug in the title. The other links within site are fine with just one variable in.

 

RewriteRule ^products/product/([0-9]+)/(.*)$ products/product.php?product_id=$1 [QSA,L]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.