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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:28:13+00:00 2026-06-09T12:28:13+00:00

I have enabled mod_rewrite and am using a .htaccess file to pass all requests

  • 0

I have enabled mod_rewrite and am using a .htaccess file to pass all requests through index.php.

If I visit the URL’s

http://localhost/mysite

http://localhost/mysite/abc

the page loads once.

However, if I add extra parts to the path, the page loads three times and my css files dont get included:

http://localhost/mysite/abc/xyz

http://localhost/mysite/abc/xyz/ttt

etc…

All cause the page to load three times. I can see this as I have a breakpoint set in index.php in Eclipse.

Here is my .htaccess file:

<IfModule mod_rewrite.c>
  RewriteEngine on

  # Block access to "hidden" directories whose names begin with a period. 
  # Files whose names begin with a period are protected by the FilesMatch directive
  # above.
  RewriteRule "(^|/)\." - [F]

  # Pass all requests not referring directly to files in the filesystem to
  # index.php. Clean URLs are handled in drupal_environment_initialize().
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^ index.php [L]
</IfModule>

Any ideas why the page is getting loaded multiple times and the css is missing?

  • 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-09T12:28:14+00:00Added an answer on June 9, 2026 at 12:28 pm

    I believe RewriteRule ^ index.php is the problem because of the space.

    try this instead:

    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    

    RewriteRule pattern substitution flags
    pattern: Is requested file index.php
    substitution: none (- means do not replace)
    flag: L – last (don’t do any more)

    Condition1: if the requested file does not exist

    Condition2: If the requested file is not a directory

    Apply next re-write rule
    RewriteRule pattern substitution flags
    pattern: anything
    substitution: /index.php
    flag: L – last (dont do any more)
    IE jump to /index.php

    so in summary:
    If file requested is index.php OK (and stop processing any more rules)
    otherwise
    If file exists do it
    If file is a directory go into that directory
    otherwise
    jump to index.php in root web directory

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

Sidebar

Related Questions

I'm redirecting this URL: http://mydomain.com/expandyourtaste Using this .htaccess file: #Expand your tastes redirects Redirect
I've enabled mod_rewrite, restarted all services, still not taking affect. Here's what I have
I have not having any luck getting my .htaccess with mod_rewrite working. Basically all
I have a relatively complex .htaccess file to control page requests, this currently redirects
I'm using Codeigniter a PHP framework and apache2. I have enabled Gzip and deflate
I have been using Amazon SES for sometime now through the PHP library found
Trying to get www.example.com/test.php?archives=testing to www.example.com/archives/testing According to godaddy they have mod_rewrite enabled by
I have enabled site-wide Django caching , but the third-party apps I am using
I have enabled google Minify in code igniter using this library on our website.
I have a page name page.php and my url as localhost/mysite/page.php , now how

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.