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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:44:54+00:00 2026-06-11T10:44:54+00:00

Hope someone can help. Apologies for not being well informed on htaccess. I have

  • 0

Hope someone can help. Apologies for not being well informed on htaccess. I have tried to search and spent a few hours on various options but no success.

I’m using a CMS where basic URLs are in the form domain.com/index.php/page-name

There is an admin setting to lose the index.php and just have domain.com/page-name, which creates the htaccess entry below:

<IfModule mod_rewrite.c>
<IfModule mod_env.c>
SetEnv gp_rewrite gJjsF6q
</IfModule>
RewriteEngine On
RewriteBase "/"
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
<IfModule mod_cache.c>
RewriteRule /?(.*) "/index.php/$1" [L]
</IfModule>
<IfModule !mod_cache.c>
RewriteRule . "/index.php" [L]
</IfModule>
</IfModule>

To take care of core canonicalisation, have been attempting to redirect any request for non www URLs to www and so far failed. Almost everything produces a server error of some sort, a 500, or, The document has moved here – Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

By tacking the www/non www rewrite at the end (as below) at least the domain functions but the redirection only works for the root. Every other page then ignores the /index.php/ rewrite and returns pages in the format domain.com/index.php/page-name again.

<IfModule mod_rewrite.c>
<IfModule mod_env.c>
SetEnv gp_rewrite gJjsF6q
</IfModule>
RewriteEngine On
RewriteBase "/"
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
<IfModule mod_cache.c>
RewriteRule /?(.*) "/index.php/$1" [L]
</IfModule>
<IfModule !mod_cache.c>
RewriteRule . "/index.php" [L]
</IfModule>
<Ifmodule mod_rewrite.c>
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
</Ifmodule>
</IfModule>

Essentially worse than no redirect. If anyone has suggestions how the core CMS needs can be maintained and the www/non www solved, they would be very welcome.

  • 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-11T10:44:56+00:00Added an answer on June 11, 2026 at 10:44 am

    You need to put the redirect rules above the rest of your rules and include a L flag:

    <IfModule mod_rewrite.c>
        RewriteEngine On
    
        RewriteCond %{http_host} ^domain.com [NC]
        RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301,NC]
    
        <IfModule mod_env.c>
            SetEnv gp_rewrite gJjsF6q
        </IfModule>
    
        RewriteBase "/"
        RewriteRule ^index\.php$ - [L]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        <IfModule mod_cache.c>
            RewriteRule /?(.*) "/index.php/$1" [L]
        </IfModule>
        <IfModule !mod_cache.c>
            RewriteRule . "/index.php" [L]
        </IfModule>
    </IfModule>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hope someone can help, I'm not a programmer, but have been interested in exploring
hope someone can help. I have two tables: Users -UserID -UserName UsersType -UserTypeID -UserID
I have a really hard time understanding routes and I hope someone can help
Hope someone can help me with this.. I have a magento store up&running, via
I hope someone can help me as I've already spent several hours trying to
I hope someone can help me out. I have a table that logs our
Hope someone can help. I have a simple scenario where clicking checkboxes is driving
I hope someone can help... This issue has been discussed here and I have
hope someone can help me out here. I have the following structure in my
Hope someone can help with a bit of a frustrating issue. I have a

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.