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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:30:50+00:00 2026-05-25T02:30:50+00:00

I am using mod_rewrite in my haccess to make clean URLs. The working directory

  • 0

I am using mod_rewrite in my haccess to make clean URLs. The working directory is webroot/subdir and htaccess resides in subdir

What I have works fine for the main folder

Options +FollowSymLinks
RewriteEngine On

RewriteRule ^projects/([0-9]+)$ ?action=projects&id=$1
RewriteRule ^projects ?action=projects

RewriteRule ^clients ?action=clients
RewriteRule ^admins ?action=admins
RewriteRule ^settings ?action=settings

so those links would be like webroot/subdir/projects or webroot/subdir/settings and they work.

My problem occurs on the projects line where I have to add an id. When I click a link that says something like: webroot/subdir/projects/284, all my style sheets and images break. My CSS is setup like so:

<link rel="stylesheet" href="resources/css/reset.css" />
<link rel="stylesheet" href="resources/css/main.css" />
<link rel="stylesheet" href="resources/css/buttonPro.css" />

Is there a way around this? Am I doing my rewrite rules wrong?

  • 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-25T02:30:51+00:00Added an answer on May 25, 2026 at 2:30 am

    Assuming that your resources folder is also in webroot/subdir, you need to make your links absolute paths. When the page changes to projects/([0-9]+), your working directory now becomes webroot/subdir/projects even though the path is being rewritten, so it is trying to look up your style sheets at webroot/subdir/projects/resources which doesn’t exist.

    Adding a / to the beginning of your locations should work:

    <link rel="stylesheet" href="/resources/css/reset.css" />
    <link rel="stylesheet" href="/resources/css/main.css" />
    <link rel="stylesheet" href="/resources/css/buttonPro.css" />
    

    If your resources folder is outside the home/root directory, you will need to specify the full path to that directory, like this:

    <link rel="stylesheet" href="/webroot/subdir/resources/css/reset.css" />
    <link rel="stylesheet" href="/webroot/subdir/resources/css/main.css" />
    <link rel="stylesheet" href="/webroot/subdir/resources/css/buttonPro.css" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to clean up my URLs using mod_rewrite in my .htaccess files. Let's
I've been using mod_rewrite in my htaccess file to rewrite my urls and I've
I have a site where I am trying to change the urls using mod_rewrite
I'm using apache's mod_rewrite to make my application's URL's pretty. I have the basics
I'm using mod_rewrite in my .htaccess to change a double directory structure into a
I'm wanting to rewrite Word Press urls using mod_rewrite in my .htaccess file in
I am using mod_rewrite to create SEO URLs. Basically the thing works in the
I'm using .htaccess and mod_rewrite to point to files that reside behind the DocumentRoot.
I'm using mod_rewrite to map my old directory structure to a new one. I
I am using mod_rewrite to remap the URLs in my website in the following

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.