Jump to content

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]
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.