I've been trying to understand the functionality of .htaccess RewriteRule.
Here is a URL example where I have experimented with .htaccess:
http://example.com/test/home
This used to be:
http://example.com/test/index.php?p=1
My goal is to redirect any path in the "test" subdirectory to the "test/index.php" page.
I have successfully achieved this.
Next, I want to make sure it works when moved to the root directory of the site.
I attempted the following:
RewriteRule ^(.*)/index test/index.php [NC,L]
However, this seems to strip away all the styling from my page, as seen below.
Here is the URL:
http://example.com/asdf/index
https://i.sstatic.net/Av3T8.png
Why does this occur and how can I resolve it?
Edit: CSS links
<!-- BEGIN THEME STYLES -->
<link href="assets/base/css/plugins.css" rel="stylesheet" type="text/css" />
<link href="assets/base/css/components.css" id="style_components" rel="stylesheet" type="text/css" />
<link href="assets/base/css/themes/custom_theme.css" rel="stylesheet" id="style_theme" type="text/css" />
<link href="assets/base/css/custom.css" rel="stylesheet" type="text/css" />
<!-- END THEME STYLES -->
Edit 2: My directory structure: https://i.sstatic.net/2engB.png