Reyan Tropia
Reyan Tropia

Reputation: 140

PHP .htaccess Redirection

Hi I'm having a problem with my redirection rule. Currently i redirect all page to index.php and the routes will check the correct controller.

  1. Everything works fine if the request is localhost/project/home
  2. But if if change the request to localhost/project/home/ all links are not working.

This is the folder architecture:

enter image description here

This what it looks like on localhost/project/home:

enter image description here

This is what it looks like on localhost/project/home/:

enter image description here

This is my .htacess:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^(.*+)$ index.php?path=$1 [QSA,L]

Thanks

Upvotes: 1

Views: 48

Answers (1)

Seems your css files are not loading because it is not getting the correct path. Better if you can use baseUrl in your css links as follows.

<link rel="stylesheet" type="text/css" href="http://localhost/project/css/style.css">

Upvotes: 1

Related Questions