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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T03:12:43+00:00 2026-05-17T03:12:43+00:00

I am trying to redirect all traffic through index.php. Here is my .htaccess file:

  • 0

I am trying to redirect all traffic through index.php.

Here is my .htaccess file:

RewriteEngine On

RewriteRule ^(.*)$ /index.php?ref=$1 [NC,L]

I’m always getting HTTP 500 errors, and I check the error.log and I see that its the internal recursion error. Can anyone help me with this? Thanks.

  • 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-17T03:12:44+00:00Added an answer on May 17, 2026 at 3:12 am

    Not entirely sure whether this is the canonical way to do this, but adding a condition like this will work:

    RewriteCond %{REQUEST_URI} !^/index.php
    RewriteRule ^(.*)$ /index.php?ref=$1 [QSA]
    

    (The QSA to add any query strings.)

    However, I would recommend an additional

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    

    to prevent static resources from being sent through your index.php (unless that is really what you want.)

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

Sidebar

Related Questions

I'm trying to internally redirect all requests to index.php and externally redirect all requests
How can I reroute all requests for php pages through index.php? My .htaccess is
I'm trying to redirect all subdirectories to the root of my website via .htaccess!
I want to use htaccess to redirect all traffic from www.oldsite.com/directory to www.newsite.com I
What I'm trying to accomplish with htaccess mod-rewrite: Redirect all sub-domains to new domain
I'm trying to access CodeIgniter URLs without 'index.php'. Here's the steps I've taken: Checked
I am trying find out how to redirect all traffic on a website from
Trying to redirect all traffic from www.old-domain.co.uk and old-domain.co.uk to www.new-domain.co.uk on a Wordpress
I am trying to redirect all my website traffic at mydomain.com to mynewdomain.net. Both
Hi I am trying to redirect all links to any pdf file in my

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.