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

  • Home
  • SEARCH
  • 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 7503465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:13:59+00:00 2026-05-29T21:13:59+00:00

My CSS styles stop working if I type any argument following my landing page

  • 0

My CSS styles stop working if I type any argument following my landing page index.php

I’m adding/testing new code on my development localhost server running xampp, coding in php/javascript/html/css.
EDIT: my development server is Windows Vista, and I use Firefox version 10.0.1 right now.

Today I was adding mod_rewrite support to allow passing an argument with the URL for my site
and stumbled on a problem I’d not thought to test before.

The mod_rewrite I was developing allows the user to specify a text string after the site name, such as:

     http://www.mysite.com/Stonehenge-artifact1

and my mod_rewrite processes that argument and does something meaningful — specifically, it redirects from my landing page index.php to a totally different page that displays a photo of Stonehenge-artifact1.

The problem — if the user types http://www.mysite.com/index.php/ialkselasdfa
all my CSS styles disappear — the index.php landing page special fonts and colors in my CSS stylesheet go missing.

I backed out all my mod_rewrite changes, including completely removing my custom .htaccess file in the mysite.com folder space (using a local custom copy of .htaccess is one of the steps for mod_rewrite).

I wanted to see if the CSS styles would disappear now that I was back to yesterday’s (pre-mod_rewrite changes) code. Sure enough, my CSS stylesheet goes AWOL if I type an argument, ANY argument, after index.php.

So the following URLs (for example) somehow disable my CSS stylesheet for index.php

www.mysite/index.php/foo
www.mysite/index.php/css-whereAreYou

(NOTE: the reason I brought up the mod_rewrite is to explain why I’m typing something at the end of my site’s URL in the first place. Were it not for me testing that new mod_rewrite code, I would not have found this problem.)

Here is my inclusion in my index.php of my CSS stylesheet:

<html>
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <link rel="stylesheet" type="text/css" href="globalStyles.css" />
 </head>

My globalStyles.css is:

root { 
  display: block;
}

body
{
   color: black;
   font-family: Gill, Helvetica, sans-serif;
   font-size: 9pt;
   background-color: RGB(243,239,240); /* light blue */
} 

p
{
    color: black;    
}

Why is my index.php landing page not getting the CSS styles when I add characters after index.php?

  • 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-29T21:14:04+00:00Added an answer on May 29, 2026 at 9:14 pm

    You could also use the <base> tag in the head section:

    <base href="base/path/for/files/to/follow">
    

    What this does is tell the browser that the path specified is the root directory, and relative paths should be requested relative to said directory.

    I encountered this same issue with mod_rewrite (and, believe it or not, this solution came out of a Google search, though I had to dig a little).

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

Sidebar

Related Questions

I need to get information about applied CSS styles in HTML page. I used
I'm using Greasemonkey and JQuerys #css method to add css styles to a page.
I have the following CSS on a button (there's other styles as well): border:
when i use: <deny users=?/> in authorization tags, CSS stop working for unauthorized visitors.
One of my css styles has a black background color and a filter with
What is the role of CSS styles in Accessibility? other than to keep presentation
I would like to apply CSS styles to links that appear in column headers
In my project i have a lot of css styles. Some of them are
I am using disqus comments for my jekyll blog with some CSS styles overriden
Out of nowhere, all of my stylesheets started throwing errors during compilation. lessc static/css/styles.less

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.