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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T02:07:48+00:00 2026-06-18T02:07:48+00:00

I have a url like domain.com/category/ Somehow, Google has picked up domain.com/category/category/ which ends

  • 0

I have a url like domain.com/category/
Somehow, Google has picked up domain.com/category/category/ which ends up somewhere else.
the “category” for the rule I would like to create will always be the same, so what I would like to do is find our if this matches and then strip either one.
The url will then go to the right place.

i.e. domain.com/category/category/ should end up like domain.com/category/ if /category/ matches the second /category/

Is this possible with a simple condition?

  • 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-18T02:07:50+00:00Added an answer on June 18, 2026 at 2:07 am

    Yes, possible with simple condition using the \1 backreference:

    RewriteCond %{REQUEST_URI} ^/([^/]+)/\1/
    RewriteRule ^/?([^/]+)/([^/]+)/(.*)$ /$1/$3 [L,R=301]
    

    Or you can just do it all in the rule:

    RewriteRule ^/?([^/]+)/\1/(.*)$ /$1/$2 [L,R=301]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a url which has some get variables in it like: domain.com/recover?email=my@email.com&token=abc123 inside
I have url http://www.domain.com/folder/?variable=1 i would like to do a mod redirect to index.cfm
I have an url like this : www.domain.com/catalog/category_name/category_id/product_name/product_id example : www.domain.com/catalog/notebook/93/4_cpu_quad_core/56 and want it
I have a URL like this http://subdomain.domain.com/xyz-200_some_information I want to convert this URL to
I have this: RewriteRule ^show_shop/([0-9]+)$ show_shop.php?id=$1 [NC] When entering the url like this: domain.com/show_shop/4
I have a URL that displays a customer list like this: http://domain.com/pls/apex/f?p=724:2:820875406836801::::: The list
I have a URL like http://domain.com/index.php?user=test When a user logs in, I want to
I have a complete URL like: A: http://www.domain.com/aaa/bbb/ccc/ddd/eee.ext . I have a relative URL
I want to implemented URL like : www.domain.com/Business/Manufacturing/Category/Product1 This will give the details of
I have a URL that looks like this http://domain.com/index.php/view/test . How do i rewrite

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.