- This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- The forum ‘Other’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
I’m not so familiar with configuring my .htaccess yet so please help me out.
I have a link that goes to the index.php but I don’t want index.php to appear in my url
eg.
http://localhost/website/index.php
I want it to be redirected to the root folder which is
So i tried searching for answers and this is what I got so far.
RewriteEngine on
Options +FollowSymLinks
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ http://localhost/website/$1 [R=301,L]
Now when I try to click home in my local website, instead of redirecting me to
my url bar displays this –
http://localhost/Applications/XAMPP/xamppfiles/htdocs/website/localhost/website/
Can anyone explain what’s going on?
> I have a link that goes to the index.php but I don’t want index.php to appear in my url
THIS is the part you don’t understand. If you don’t want the link to show `…index.php` in the address bar, then change the link, not your server. In and of itself, this has absolutely nothing to do with mod_rewrite.
Take this
…and replace it with this
In most cases, you won’t need to do anything more – when given a path to a directory, Apache is typically already configured to look for a file named `index.php` (among others) and serve it if found.