0

I've added a .htaccess file to redirect some of the requests, for example: /home/index becomes /index.php?controller=home&action=index&params=, but that .htaccess file prevents me to access /content/styles.css file too. For some reason I can access /content/images/default.png.

Htaccess contents:

Options +Indexes
Options -MultiViews
RewriteEngine On

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

RewriteRule ^(.[^\/]+)\/(.[^\/]+)\/(.+)\/*$ index.php?controller=$1&action=$2&params=$3 [QSA,L]
RewriteRule ^(.[^\/]+)\/*$ index.php?controller=$1 [QSA,L]
RewriteRule ^(.[^\/]+)\/(.[^\/]+)\/*$ index.php?controller=$1&action=$2 [QSA,L]

And it's located in public_html directory.

I've tried to add another .htaccess with Options +Indexes to /content/ directory, but no change. Accessing any file from /content/ but no /content/images/ is prevented.

This: <link rel="stylesheet" href="/content/styles.css" /> - doesn't work. This: mysite.com/content/styles.css - doesn't work. This: mysite.com/content/images/default.png - works.

//Edit:

When I move /content/styles.css to /content/styles/styles.css is works well, but is there something wrong with this config?

1 Answer 1

1

Add this tag in pages where you want to access css and png files.

<base href="http://www.yourdomain.com/" />

And then try to access that page.

Sign up to request clarification or add additional context in comments.

1 Comment

That haven't worked for me, I have put that line in both index.php in public_html and in `layout.php' which contains html for all pages. It might be some weird .htaccess config in other file (site is hosted by a company), although I didn't find one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.