Answer the question
In order to leave comments, you need to log in
Why does the CNC call give a 404 error?
I decided to understand the operation of the CNC and make my own simple example.
There is a page /projects/index.php - displays a list of projects
It is necessary that at /projects/nazvanie-proekta/ - a description of the project is displayed.
/projects/ - opens
/projects/nazvanie-proekta/ - gives 404 error
In the .htaccess file I wrote as follows:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^projects/([a-zA-Z0-9\-]*)/$ /projects/index.php?pr_url=$1
Answer the question
In order to leave comments, you need to log in
If .htaccess is in the root of the site then
if in projects then
RewriteRule ^([a-zA-Z0-9\-]+)/?$ index.php?pr_url=$1
there is no character / after the ^ character
The ^ character denotes the beginning of a line, so ^projects does not match the /projects line
And it is better to change the asterisk to a plus sign, otherwise the /projects// lines will fall under the pattern in this variant.
Final rule:
RewriteRule ^/projects/([a-zA-Z0-9\-]+)/$ /projects/index.php?pr_url=$1
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question