Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8827535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:23:39+00:00 2026-06-14T07:23:39+00:00

I had a look at a few possible duplicates for this question but rewrite

  • 0

I had a look at a few possible duplicates for this question but rewrite rules are fairly specific to projects so I couldn’t find a suitable answer.

Crux of issue? Requests for certain files (CSS, JS & images) are being rewritten (I think) by the htaccess file.

I have an htaccess file set up to direct as follows:

Options +FollowSymLinks
RewriteEngine on
RewriteCond  %{REQUEST_FILENAME} !-f
RewriteCond  %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z]*)/?([a-zA-Z]*)?/?([a-zA-Z0-9]*)?/?$ index.php?controller=$1&action=$2&id=$3 [NC,L]

It takes a URL like localhost/framework/booking/dashboard and rewrites to localhost/framework/index.php?controller=booking&action=dashboard

The relevant file structure inside my local www folder looks something like:

framework
 -index.php
 -htaccess
 -views
  -Booking
   -dashboard.php
   -wuxia-blue.css

The CSS link in dashboard.php is as follows:

<link rel='stylesheet' type='text/css' href="wuxia-blue.css">

The HTTP request being made seems to be:
/framework/booking/wuxia-blue.css

It should be:
/framework/views/booking/wuxia-blue.css

Ideally, I’d like to use something similar to

href="<?php echo(CSS . "wuxia-blue.css"); ?>".

Where CSS is a defined constant in the application and where wuxia-blue.css (and all other css files) are contained in a predefined folder of stylesheets. Obviously this would apply to other assets like .js files and images.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:23:40+00:00Added an answer on June 14, 2026 at 7:23 am

    The htaccess rule is correct – the problem is with your folder structure.

    When you create a relative link, it’s relative to the current URL as displayed in the address bar – the location of the file you’re in isn’t relevant.

    Your view file is at /framework/views/booking/dashboard.php, but the browser just sees the url /framework/booking/dashboard. That means the browser interprets the location of the resource to be /framework/booking/dashboard/wuxia-blue.css

    Personally, I’d recommend just keeping all your css and images outside of the framework in /images and /css. Otherwise, may have to add some code in your framework to serve up image files, since all the image requests will be running through your framework.php file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've had a look around SO and Google but can't find a definite and
I've had a look around on StackOverlow but haven't been able to find a
I've had a look around for the answer to this, but I only seem
I had a look on the site and on Google, but I couldn't seem
I haven't done this in quite a few years and forgot. Had to look
I've had a good look around but havnt been able to find a solution
I've had a look at a few threads but what I'm aiming for I
I had a look through the documentation on the Wiki, but it seems a
I had a look around and didn't find what I was exactly looking for.
I have had a look all over, but it doesn't seem as though my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.