.htaccess add new file

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /homepage/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /homepage/index.php [L]
</IfModule>

This is my .htaccess code. I created a new file on /test.php main page, and when I find it in a browser, it gives access error
 i have tried by replacing index.php with test.php but it still not working.
Can someone explain to me how this code works and why my code doesn't work.

i have deleted .htaccess but its still not working. What else file it can be.
+3
source share
1 answer

Edit

RewriteRule . /homepage/index.php [L]

at

RewriteRule (.+) /homepage/index.php?page=$1 [L]

PS For this to work, your index.php must listen to $ _GET ['page'] and load the corresponding resource.

EDIT: without using "? Page = $ 1", your code will only display the index page for all requests that are not files or directories. I'm not sure this is what you were aiming for.

0
source

All Articles