You can also force refresh on the webpage by pressing Ctrl + F5. Now .htaccess code will work without having to restart the webserver.Thank you, but how do i restart my server? I am on namecheap
What's your httpd? Apache, Nginx, OpenLiteSpeed...?Nope this doesn't help. Still showing index.php & index2.php tho...
Try removing this line and access the page from another browser.Nope this doesn't help. Still showing index.php & index2.php tho...
RewriteBase /
My website only contains these 2 files but i can make more in future maybe... so i just want everything after my domain to be removed if is possibleThis is a very easy solution.
Do you want that EACH PAGE redirect to index.php
OR
index2.php redirects to index.php.
Explain clearly your needs.
I want both of the files to be accessible because i send the user from index.php to index2.php but i dont want any of the links to be show in the url address bar
i just want my domain to be shown.
Ok but can i remove index2.php only? since index.php doesnt show when user visit the pageBut you can not do this!
A user has to see example.com in his address bar and not example.com/index2.php?
If you are looking for this is not possible.
It should work. Are you sure you saved the .htaccess file in the same folder where index.php resides?and removing the / didnt helped
Ok but can i remove index2.php only? since index.php doesnt show when user visit the page
Why would i remove the index2.php file and redirect to an error? I dont get it.remove index2.php file from filesystem (fast solution but generate a 404 error).
or
Redirect via htacess index2 to index
lolStart over
Yes the mod_rewrite is enabled by default on namecheap
- Check PHP information and see if mod_rewrite module is enabed on your webserver.
- Is the index.php created by any PHP framework or you created it manually?
Take a look at PHP Routing.Is it possible i hide/remove all URL's after my domain name?
I have 2 files index.php and index2.php i dont want them to appear in the url search bar
I want my domain to show only. `example.com`