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 6778251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:14:42+00:00 2026-05-26T16:14:42+00:00

Let’s say, the default controller is root.php then both URLs will work website.com/ website.com/root

  • 0

Let’s say, the default controller is root.php then both URLs will work

website.com/
website.com/root

if controller has a function named login then this URL is also valid

website.com/root/login

but the HTML template that used to work in first example, doesn’t work in the second, e.g. this relative path is no longer valid

<link rel='stylesheet' href='stylesheets/style.css'/>

and instead for website.com/root/login I have to use a different path

<link rel='stylesheet' href='../stylesheets/style.css'/>

even though I’m in the same controller and trying to use the same stylesheet.

Is there a way around it?

  • 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-05-26T16:14:42+00:00Added an answer on May 26, 2026 at 4:14 pm

    It is because the browser is looking for the stylesheets relative to the url in the address bar.

    so the in the case of the first stylesheet in the second url, ie:

    <link rel='stylesheet' href='stylesheets/style.css'/> @ website.com/root/login
    

    The browser is looking for the file at

    website.com/root/stylesheets/styles.css
    

    Which is not where the files are kept. I assume they are actually at website.com/stylesheets/styles.css.

    The easiest way around this is to simply make all the paths relative to the root of the website.

    so if you try this, you should find that it works.

    <link rel='stylesheet' href='/stylesheets/style.css'/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I'm writing a PHP (>= 5.0) class that's meant to be a
Let say I am at my View loaded by my controller named Book. Is
Let's say that I'm currently designing an application where I will need to use
Let's say i have an android device that has some extra buttons on it,
Let's say I have two assemblies: BusinessLogic and Web. BusinessLogic has an application setting
Let's say we have a table that has 2 million rows. It has two
Let's say you create a wizard in an HTML form. One button goes back,
Let's say I'm building a data access layer for an application. Typically I have
Let's say you have a class called Customer, which contains the following fields: UserName
Let's say we have a simple function defined in a pseudo language. List<Numbers> SortNumbers(List<Numbers>

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.