-1
I need to set up a redirect through . htaccess.
My "DOCUMENT_ROOT" (using Apache and PHP) is set to "www", which is the root of the project, but index.php is in the "public" folder".
I don’t know if it has to do with versions, but the guy’s tutorial says the following:
In the www folder, a . htaccess with the contents below:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /public/index.php?url=$1 [QSA, L]
And in the public folder, a . htaccess with the contents below:
Option -Indexes
However, like many tutorials, it did not work!! Which leads me to think that it is something to do with version, because in the presentation it works!
My project I’m simulating locally, so my url is "http://localhost/".
That should be redirected to "http://localhost/public/index.php" and should still continue to show "http://localhost/" in the browser.
I found several "solutions", both here and abroad, but none worked.
I forgot to comment!! Mas.. I believe it refers to the line: Loadmodule rewrite_module modules/mod_rewrite.so Well, I had already uncommented it, and... it didn’t work!!! In the case of the www directory, it is my root directory, where the redirect . htaccess.
– Luiz
your mod_rewrite is working, once you have uncommented you need to restart apache to work.....
– Romeu Gomes - Brasap
https://httpd.apache.org/docs/2.2/pt-br/howto/htaccess.html
– Romeu Gomes - Brasap
gives a read on this howto apache, because it will help you if you need to enable the file, because it may be configured with another name, or not configured.....
– Romeu Gomes - Brasap
I’ll read, but.. I did the procedure as it is, ie... I enabled the line and restarted apache.. I still cleaned cache, updated the page.. and.... nothing!!! strange!!
– Luiz