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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:32:07+00:00 2026-06-16T19:32:07+00:00

I am struggling with .htaccess, I have this code: <pre> # PRODUCTS RewriteRule ^(.*)/(.*)$

  • 0

I am struggling with .htaccess, I have this code:

<pre>
# PRODUCTS
RewriteRule ^(.*)/(.*)$     /newwebsite/product.php?category=$1&product=$2 [L,NC]

# SERVICES
RewriteRule ^(.*)/(.*)$     /newwebsite/service.php?category=$1&service=$2 [L,NC]

# PLAIN PAGES
RewriteRule ^/$                             /newwebsite/index.php  [L,NC]
RewriteRule ^signup-free$                   /newwebsite/signup-free.php  [L,NC]
RewriteRule ^about$                         /newwebsite/content.php?page=1 [L,NC]
RewriteRule ^portfolio$                     /newwebsite/portfolio.php [L,NC]
RewriteRule ^our-stores$                    /newwebsite/our-stores.php  [L,NC]
RewriteRule ^contact$                       /newwebsite/contact.php  [L,NC]
RewriteRule ^products-list$                 /newwebsite/lists.php?action=products  [L,NC]
RewriteRule ^services-list$                 /newwebsite/lists.php?action=services  [L,NC]
</pre>

My code is not working properly, I need to add something to Products and Services rules to make them redirect to ‘product.php’ and ‘service.php’ respectively, without adding no more ‘slash’ or ‘subfolder’, but I don’t know what and how, I mean I just need that:

http://www.root.com/maintenance-services/weekly-pool-service  
  redirects to =>  
http://www.root.com/service.php?category=maintenance-services&service=weekly-pool-service

but at the same time I need that:

http://www.root.com/hot-tubs/jacuzzi 
  redirects to =>  
http://www.root.com/product.php?category=hot-tubs&product=jacuzzi

How can I make a difference between PRODUCTS and SERVICES, how can I tell apache to go to different pages with the same parameters?

I am confused. Thank you very much.

  • 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-16T19:32:09+00:00Added an answer on June 16, 2026 at 7:32 pm

    Make file rewrite.php, redirect everything there:

    RewriteRule ^(.*)/(.*)$     /newwebsite/rewrite.php?sub=$1&second=$2 [L,NC]
    

    Put all logic in this file.

    Pseudo code

    if($_GET['sub'] exists in table "service") {
       $_GET['category'] = $_GET['sub'];
       $_GET['service'] = $_GET['second'];
       include 'service.php';
    }else{
       ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to configure a .htaccess RewriteRule and i'm struggling. I have a domain
Im struggling with this one. I have a list of items and on a
I've been struggling to get the following rewrite working ^/agatedepot/([0-9.]+)/([0-9a-zA-Z._]+)\?doc-id=([0-9a-zA-Z._\-]+) to /agateDepot.php?date=$1&filename=$2&doc-id=$3 I know
I have been struggling with this problem on hostgator shared hosting server for the
Struggling to work this one out; I have a (Tomcat6 'Context.xml') default document, which
Struggling still with this after hours or research.. I have a simple helper class
Struggling to write this code. I'm trying to calculate the highest value from a
I´m struggling to understand this concept: I have a fixed size definition: (from http://msdn.microsoft.com/pt-br/library/aa931918.aspx
im struggling with abit of java code. Currently i have 8 rooms room1 =
Really struggling with this one: I have an existing foreach, containing an if loop

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.