Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. .htaccess Query String Redirect

.htaccess Query String Redirect

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
apachedatabasecomtutorialquestion
1 Posts 1 Posters 6 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Aruna KN
    wrote on last edited by
    #1

    I want to redirect URLs with a query string to another query string using .htaccess From: https://example.com/?smp=123456 (Any number after =) To: https://example.com/?p=123456 (Same number as in From URL) Please suggest me a code. I tried following but it's not working.

    RewriteEngine on
    RewriteCond %{QUERY_STRING} ^/?smp=([0-9]+)$ [NC]
    RewriteRule ^$ https://www.example.com/?p=$ [R=301,L]

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups