Answer the question
In order to leave comments, you need to log in
CNC shaping not working via .htaccess?
There is a wordpress site with the wp-shop plugin that generates system pages like
mjstore.ru/products-page/?category=6&product_id=23
Generated a rewrite rule like
RewriteRule RewriteRule ^category-([^-]*)-product_id-( [^-]*)\.html$ /products-page/?category=$1&product_id=$2 [L,QSA]
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^category-([^-]*)-product_id-([^-]*)\.html$ /products-page/?category=$1&product_id=$2 [L ,QSA]
RewriteRule . /index.php [L]
But for some reason, it's not that it doesn't work, so the site also stops loading. Please tell me where is the mistake.
Answer the question
In order to leave comments, you need to log in
It was
became
RewriteEngine On
RewriteBase /
RewriteRule ^category-([^-]*)-product_id-([^-]*)\.html$ /products-page/?category=$1&product_id=$2 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
An example of a url is this mjstore.ru/products-page/?category=6&product_id=23
I would like it to be transformed into this form:
mjstore.ru/products-page/page6
To do this, I made a new function:
RewriteRule ^products-page/ page([^/]*)$ /products-page/?category=$1&product_id=23 [L] [QSA]
To be honest, I didn't understand what the order should be. Such?
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteRule ^products-page/page([^/]*)$ /products-page/?category=$1&product_id=23 [L] [QSA]
Should I include another RewriteCond?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question