D
D
Dmitry2015-07-16 15:27:32
htaccess
Dmitry, 2015-07-16 15:27:32

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

2 answer(s)
S
ShamblerR, 2015-07-16
@ShamblerR

It was
became

RewriteEngine On
RewriteBase /
RewriteRule ^category-([^-]*)-product_id-([^-]*)\.html$ /products-page/?category=$1&product_id=$2 [L,QSA]

But it seems to me that there will be more problems with get requests, and the regular season itself is strange.
Can I have a couple of URLs for viewing?
This is very embarrassing
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

similar to the condition for the cnc
which is triggered for
not for
Short cut your line below
RewriteCond - if
RewriteCond - if
RewriteCond -if
RewriteRule
-then RewriteRule - the next rule is not related to the first conds

D
Dmitry, 2015-07-16
@Dorofeevdima

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 question

Ask a Question

731 491 924 answers to any question