Answer the question
In order to leave comments, you need to log in
How to shorten two URLs at once with .HTACCCESS?
Hello!
Tell me, please, what to do in this situation:
Some pages of the site are located at domain.com /posts /name.php
Other pages of the site are located at domain.com /pages /name.php The task is to remove posts/
from the addresses of these pages and pages/ respectively.
To solve the problem, I tried to apply the rules in .htaccess:
RewriteRule ^([A-z0-9-]+)$ /posts/$1
RewriteRule ^([A-z0-9-]+)$ /pages/$1
As a result, this is:
Answer the question
In order to leave comments, you need to log in
Thank you all for your participation.
1. We enter all the information about the page into the MYSQL database
2. We generate the page from the database "on the fly":
3. We set the generated page to the CNC (Human Understandable URL)
: to his daddy in the database, and PAGES in his.
Everything is clean. If there is a better way to do it, please correct me.
in conda create conditions or, or
actually and that's it
RewriteCond %{REQUEST_URI} ^([A-z0-9-]+)$/(posts|pages)/([A-z0-9-]+)/$1 [NC]
RewriteRule .* http://site.ru/%1%3
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question