But neither work for me. When i type in the link homelogin it directs perfectly. The only problem is that the link name should say homelogin but instead says index.php
What am i doing wrong? How could i find out exactly where the problem is?
RewriteEngine on
RewriteRule ^/?homelogin$ index.php [L]
RewriteRule ^/?homepage$ view/index.php [L]
… is where DocumentRoot is located (above your personal directory) and where the .htaccess file is located (in your personal directory).
DocumentRoot is important as it means that your RewriteBase / made all your redirections relative to the server’s DocumentRoot - UNDESIRABLE! It also impacts the leading / for subdirectories so you could use ^/? at the start of any regex which addresses the URI starting with your directory.
The .htaccess file’s location is important as all the regex and redirections are relative to that.
The reason is very clear to me: You are using an external absolute redirect which, by definition, will be displayed in the browser’s location box. That’s the why answer. The “how to” answer is to make the links internal and relative, i.e., (eliminate the red code - assuming that your .htaccess is in the ~ibrarhussain directory):