routes question |
This is only partially a Codeigniter question perhaps, but since I am working with CI, I will give it a shot.
My app's public files are placed on a subdirectory of a domain, say: https://mydomain.com/movies/ The server is an apache server. And I need to make one controller accessible to the outside world in a way that the subdirectory through which the app is accessible would not be visible; let's say the controller is Dogfood.php and I need it's methods to be accessible via such link: https://mydomain.com/dogfood/ So, if a user tries to access https://mydomain.com/dogfood/, he would be, under the hood, accessing https://mydomain.com/movies/dogfood/. But this should be hidden from the user. I can write a rule in the public_html/ folder's .htaccess file that would work for regular files if the "dogfood" was a directory (without it's own .htaccess file), so trying to access https://mydomain.com/dogfood/image.png would load https://mydomain.com/movies/dogfood/image.png : Code: RewriteRule "^dogfood/(.*)$" "/movies/dogfood/$1" [PT] But, if I try it on a CI4 installation in the movies folder and instead of files try to access the methods of dogfood controller, that same rule in combination with codeigniter's .htaccess file produces a redirect, revealing the address https://mydomain.com/movies/ to the user. Is there any simple solution to this issue? Here is the .htaccess file in the subdirectory movies/ where the public CI4 installation files are: Code: # Disable directory browsing
==
Donatas G. |
Messages In This Thread |
routes question - by dgvirtual - 01-11-2023, 10:30 AM
RE: routes question - by luckmoshy - 01-11-2023, 09:23 PM
RE: routes question - by InsiteFX - 01-12-2023, 01:04 AM
RE: routes question - by dgvirtual - 01-12-2023, 02:24 AM
|