Answer the question
In order to leave comments, you need to log in
How to hide folders in an address?
Hello, how can I hide folder access using mod_rewrite?
Now I'll explain a little, there is a "module" folder in the root of the site, and in .htaccess I wrote the following code:
RewriteRule ^module$ index.php?direction=module [L]
RewriteRule ^([a-zA-Z0-9_-]+ )$ index.php?direction=$1 [L]
But, when you click on the site.net/module link, it still goes to the folder, and not to index.php
How do I solve this problem? Well, so that the folder names do not conflict. After all, there are other folders, and I want to somehow hide them, and completely control the url.
PS and this, is it possible somehow to redirect everything that comes after site.net/......... to index.php/?url=..........?
Thanks in advance!!!!
Answer the question
In order to leave comments, you need to log in
Deny access to directories:
RewriteEngine on
RewriteRule ^module$ /index.php?direction=module [L]
RewriteRule ^([a-zA-Z0-9_-]+)$ /index.php?direction=$1 [L]
PS and this, is it possible somehow to redirect everything that comes after site.net/......... to index.php/?url=..........?- Alas, no ... Because it will redirect everything to nowhere, for example: you go to site.net/index.php?url=example, here is the cycle ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question