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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:49:05+00:00 2026-06-15T16:49:05+00:00

Website use the opencart cms, SEO url enabled, so the .htaccess looks : RewriteRule

  • 0

Website use the opencart cms, SEO url enabled, so the .htaccess looks :

 RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

all works perfect, but i wanted to add the 301 redirect from non www to www, so i added:

RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule ^(.*) http://www.example.com/$1 [R=301,L]

It works, but when i try to redirect link with category or product it adds “index.php?route=”

Example:

“www.example.com/cats”, if i try “example.com/cats” without “www” the link will look http://www.example.com/index.php?route=cats

  • 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-15T16:49:06+00:00Added an answer on June 15, 2026 at 4:49 pm

    You need to add all of your redirects before any routing rules (e.g. the rules you have that route things to index.php. So your htaccess file needs to look something like this:

    # redirect rules first
    RewriteCond %{HTTP_HOST} ^mysite.com$ [NC]
    RewriteRule ^(.*) http://www.mysite.com/$1 [R=301,L]
    
    # then routing rules
    RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
    RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
    RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a regular expression to match this URL to enable URL rewriting. http://www.somewhere.com/index.php?route=common/home
I have a website that use this style : /index.php?page=45&info=whatever&anotherparam=2 I plan to have
Possible Duplicate: How to: URL re-writing in PHP? How can a website use an
I am programming a website that use jQuery's asynchrony to call php scripts. To
I have a website, in this website I use various 3rd party PHP scripts,
On my website I use PHP sessions. Session information is stored in files in
I am designing a Q & A website use php. Here is the directory
I am moving my website to use cake php and before i would just
For my website I use the PHP API for Flickr ( http://www.flickr.com/services/api/ ). This
On my website I use include($_SERVER[DOCUMENT_ROOT] . /header.php); to include my header. But in

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.