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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:33:29+00:00 2026-05-24T10:33:29+00:00

I have a URL like http://domain.com/index.php?user=test When a user logs in, I want to

  • 0

I have a URL like http://domain.com/index.php?user=test

When a user logs in, I want to show a URL like http://domain.com/user (user will be dynamic).

How might I achieve this with URL rewriting using PHP?

  • 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-24T10:33:31+00:00Added an answer on May 24, 2026 at 10:33 am

    You should use something based off .htaccess. Take WordPress’ for instance:

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

    This says grab any page which does not exist (such as “user” in your case), and redirect to the main index.php file.

    That main index.php can then grab the “user”, and you can use it to grab data from your database and show whatever you want.


    EDIT– similar to AlienWebguy’s answer

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^like/(.+) /like.php?user=$1 [L]
    </IfModule>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a URL that looks like this http://domain.com/index.php/view/test . How do i rewrite
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: http://www.w3schools.com/PHP/func_string_str_split.asp I want to split that url to
I have a url that looks like that http://example.com/index.php?id=111&title=word1 word2 word3 I need to
I have a URL structure like this http://domain.com/page/thing1 http://domain.com/page/thing2 http://domain.com/page/thing3 I want to: remove
I have a dynamic URL (http://domain.com/getUsers.php?team=1) that if its manually accessed, returns some Json
HEllo I have this URL I need to get with PHP http://www.domain.com/forum/#forum/General-discussions-0.htm The problem
I have the following page: www.domain.com/index.php?route=information/contact and I'd like to rewrite it so that
I have URL like: http://example.com#something , how do I remove #something , without causing
If I have a URL like http://popurls.com/go/msn.com/l4eba1e6a0ffbd9fc915948434423a7d5 , how do I expand it back

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.