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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:50:15+00:00 2026-05-20T00:50:15+00:00

In short, I’m trying to change the given URL: http://mydomain.com/category/title/attachment/randomstring_?resolution=320×480 With http://mydomain.com/category/title/attachment/randomstring_320x480 In essence,

  • 0

In short, I’m trying to change the given URL:

http://mydomain.com/category/title/attachment/randomstring_?resolution=320x480

With

http://mydomain.com/category/title/attachment/randomstring_320x480

In essence, removing ?resolution= from the query string and adding the value to the path.

The category, title, and randomstring values are dynamic, but their placement should always be the same.

I don’t know if it matters, but this is being used in WordPress.

I tried the following, but I just get a 404:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{QUERY_STRING} ^resolution=([0-9]{3,4}x[0-9]{3,4})$
RewriteRule ^$ ${REQUEST_URI}%1/? [R]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

any help is appreciated 😉

  • 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-20T00:50:16+00:00Added an answer on May 20, 2026 at 12:50 am

    Well, after a lot of trial and error (and reading RewriteLog output), I finally got it working with the following:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    RewriteCond %{QUERY_STRING} ^resolution=(.*)$
    RewriteRule . %{REQUEST_URI}%1? [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    

    The key issues with the original solution:

    • Using ^$ instead of . in the RewriteRule
    • Using /? instead of just ? in the RewriteRule
    • Not including ,L in the RewriteRule flags

    For anyone who is curious, including ? in the RewriteRule prevents the QUERY_STRING from remaining in the request.

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

Sidebar

Related Questions

Short Working on login system and trying to implement remember me feature. Recently, l
Short version: How can I get the URL of the server my MVC3 project
Short Trying to get table with exact dimensions for a4 print Table's first and
Short Question: Given Clojure's concurrency model, how do I ensure that all LWJGL OpenGL
Short question. I have two models: class Author(models.Model): name = models.CharField(max_length=250) class Book(models.Model): title
Short question: I've a group that could change grouping condition in runtime (see details
Short question: Why does the background-color of .b does not change when I hover?
Short question: Given a point P and a line segment L, how do I
Short question, is the following ok: struct X { A& x; A y; X()
Short one: Am I correct in assuming, that the Samsung Galaxy S wifi 4.0

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.