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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:55:48+00:00 2026-06-15T10:55:48+00:00

I have the following .HTACCESS: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ –

  • 0

I have the following .HTACCESS:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
</IfModule>

The problem is then when I try and put an image in the webpage, or include a CSS or JS file in the <head> tag, it routes everything through to my index.php. How can I prevent/work around this?

The aim is to have all traffic directed to my index, i.e. when the given URL is domain.com/shop or domain.com/signup then they would be taken to shop.php or signup.php respectively. The problem is when including images and the like the routing through to index.php screws it over. If I simply have an image tag:

<img src="/img/foobar.jpg"> Then the image tries to load index.php with the attributes /img/foobar.jpg. Which is not what I want to do.

The only solution I can think of is to hardode the URL in for every image. i.e.

<img src="<?=HARDREF;?>/image.jpg">

  • 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-15T10:55:50+00:00Added an answer on June 15, 2026 at 10:55 am
    <IfModule mod_rewrite.c>
    
    RewriteEngine On
    RewriteBase /
    
    # if file not exists
    RewriteCond %{REQUEST_FILENAME} !-f
    
    # if dir not exists
    RewriteCond %{REQUEST_FILENAME} !-d
    
    # avoid 404s of missing assets in our script
    RewriteCond %{REQUEST_URI} !^.*\.(jpe?g|png|gif|css|js)$ [NC]
    
    RewriteRule .* index.php [QSA,L]
    
    </IfModule>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have following .htaccess RewriteEngine On DirectoryIndex index.php RewriteRule ^([a-zA-Z0-9_-]{3,20})/([^/]+)/([^/]+)?$ index\.php?page=$1&s=$2&o=$3 [L] RewriteRule ^([a-zA-Z0-9_-]{3,20})/([^/]+)?$
I currently have the following htaccess <IfModule mod_rewrite.c> # redirect all calls to index.php
I have the following in my .htaccess currently- <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^go/([^/]*)/([0-9]+)/([0-9]+)/?$
I have the following rules in my .htaccess: <IfModule mod_rewrite.c> RewriteEngine on RewriteCond $1
I have the following .htaccess config RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^example.com [NC]
I currently have the following htaccess rewrite rule: RewriteRule (.*) index.php/$1 [L] How do
I have the following rewrite rules: <IfModule mod_rewrite.c> RewriteEngine on RewriteBase / # Route
I have the following .htaccess file in a directory: RewriteEngine On RewriteCond %{HTTPS} !=on
I have the following in a .htaccess file as a test: RewriteEngine on RewriteRule
I have following in htaccess file: RewriteCond %{HTTP_HOST} ^(www.)?abcdef.com$ RewriteRule (.*)$ http://www.xyz.org.il/$1 [R=301,L] but

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.