A
A
artemka852016-04-09 13:15:26
PHP
artemka85, 2016-04-09 13:15:26

How to make a CNC?

Good afternoon . The essence of the question is this:
There is a website: example.com
Original page of the form: example.com/advice.php?id_advice=1 (Dynamic number)
I made it like this: example.com/advice/80 (Well, the number changes accordingly)
Here is the code in .htaccess file:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^advice/([0-9]+)$ ./advice.php?id_advice=$1

Everything works, but! When I go to a new address, then
All connected files: for example, css, js, etc. give an error, because advice / 80 is supposedly considered
a folder or something like that.
And to do something like this in .htaccess: RewriteRule ^advice/([0-9]+)$ ../advice.php?id_advice=$1
That is: ../ , DOES NOT GIVE AN ERROR
Of course I can, make the path in css like this : ../
But, I would like without these alterations...
Thank you in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
trevoga_su, 2016-04-09
@artemka85

1. forget about URL conversions at the htaccess level - www.phpinfo.su/articles/practice/chpu_na_php.html
2. write paths to css/js from the root

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question