Z
Z
Zimaell2019-12-23 12:36:13
Apache HTTP Server
Zimaell, 2019-12-23 12:36:13

How to properly configure Apache directories and understandable links?

I need to make readable links, like " https://my_site/category/news/1/test...... "
there are a lot of .htaccess examples on the net, almost everything boils down to this example

<IfModule mod_rewrite.c>
RewriteEngine On  
RewriteCond %{SCRIPT_FILENAME} !-d  
RewriteCond %{SCRIPT_FILENAME} !-f  
RewriteRule ^(.*)$ ./index.php?route=$1
</IfModule>

but as soon as I go to any link, I get a 404 error, that is, this example does not work for me.
Having rummaged, I also read (though without examples) that you need to somehow allow and prescribe rules in the Apache config.
Tell me how and what I need to configure so that there are links of the type described above?
In addition, all directories should be closed, that is, all requests should be sent only to index.php ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MaxxZ, 2019-12-24
@MaxxxZ

Is rewrite enabled?
If anything, it is included in debian
a2enmod rewrite
service apache2 restart

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question