Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
but every time I navigate each page it always append in my path this
The easiest way is to edit the httpd-vhosts.conf file and make the local website’s DocumentRoot your public_html folder.
Personally, I’d make /site your DocumentRoot so you can have multiple virtual domains on your test server.
Edit (admin mode) c:\Windows\System32\drivers\etc\hosts to add “127.0.0.1 site”; be sure to be in admin mode or WinDoze will not allow you to save.
Edit your {apache-path-to-conf/extra/httpd-vhosts.conf to add:
<VirtualHost 127.0.0.1:80>
ServerName site
DocumentRoot W:/site
// be sure to use the correct path - I have my websites on a W partition
ServerPath W:/site
// ditto
RewriteEngine on
Rewrite Rule ^site/([a-z]+)$ home/expensex/public_html/site/$1 [L]
Assuming that you can do that, it will capture every lowercase file request for your site directory and redirect it internally to the correct (extensionless) file.
Okay, stuck on a freebie server means that you MUST run though your “domain’s” DocumentRoot so you will have to place your code in the first directory level in the path to which you have access (and you will NOT be able to “hide” any levels above that on the server - that’s the cost of freebie servers).
Note: Good hosts can provide very inexpensive shared accounts where you control your own domain name and don’t even need to make a redirection like you’re trying to make.