Hello,

I am having a problem with .htaccess file here. I am having a program written with laravel and whatever /... I write change into localhost/dashboard.

Someone mention I need to change the .htaccess file but I do not know how to. If anyone here can help me please do so. Here is my

.htaccess

 <IfModule mod_rewrite.c> <IfModule mod_negotiation.c>
       Options -MultiViews
   </IfModule>

   RewriteEngine On

   RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

   # Redirect Trailing Slashes If Not A Folder...
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule ^(.*)/$ /$1 [L,R=301]

   # Handle Front Controller...
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteRule ^ index.php [L]
  </IfModule>

Recommended Answers

All 3 Replies

Hi davy,

the .htaccess seems to be fine, so I have some questions for you:

  • which web server are you using?
  • Are you using a virtual host config?
  • Which is the document root?
  • What do you expect to get instead of http://localhost/dashboard ?

Right now, the document root is localhost.

I try to type /admin and expect the admin page to ask me to input login and password yet it does not appears.

I don't know the web server name - yet it appears just like the other web server.

A virtual host config? I'm not quite sure about this.

Comment the rules in the .htaccess file and try again to access /admin. If you get redirected post the code of /admin.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.