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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:09:30+00:00 2026-06-07T08:09:30+00:00

I have this url http://mysite.com/profile?id=78 I wanted to changed it to be like this

  • 0

I have this url

http://mysite.com/profile?id=78

I wanted to changed it to be like this

http://mysite.com/78/

How would I do that?

I have this code in my htaccess, but it seems it’s not working.

RewriteRule ^id/([a-zA-Z0-9]+)/$ profile?id=$1

Kindly guide me on this one.

Your help would be greatly appreciated and rewarded.

Thanks!

  • 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-07T08:09:31+00:00Added an answer on June 7, 2026 at 8:09 am

    I am pretty sure that you should use the RewriteBase directive

    RewriteEngine On
    RewriteBase /
    # Use the following rule if you want to make the page like a directory
    RewriteRule ^u/(!(profile.php))$ u/$1/ [R=301,L]
    # The following rule does the rewrite.
    RewriteRule ^u/(!(profile.php))/$ profile.php?name=$1 [L]
    

    This will rewrite http://mysite.com/u/john/ to http://mysite.com/profile?name=john.

    Edit this is the new answer

    RewriteEngine On
    RewriteBase /
    # Use the following rule if you want to make the page like a directory
    RewriteRule ^u/(!(profile.php))$ u/$1/ [R=301,L]
    # The following rule does the rewrite.
    RewriteRule ^u/(!(profile.php))/$ profile.php?name=$1 [L]
    # The following rewrite the other way round:
    RewriteCond %{REQUEST_URI} ^/profile.php
    RewriteCond %{THE_REQUEST} ^(GET|POST|HEAD|TRACE)\ /profile.php
    RewriteCond %{QUERY_STRING} name=([^&]+)
    RewriteRule ^profile.php$ u/%1? [R=301,L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a website with a URL like: http://mysite.com/this-is-a-page and then I use that
I have this url: http://mysite.com/home.php?name=username I want to be able to access that by
I have this url: http://mysite.com/content/14 and this line in htaccess file: RewriteRule ^content\/([^-]+)$ index.php?m=apple&id=$1
How can I hide the parameters in Codeigniter? I have this URL: http://example.com/profile/1 I
I have a url string like this: http://www.google.com/cse?cx=017840637368510444960:ny1lmky7r-0&client=google-csbe&output=xml_no_dtd&q=simon+g I need to send this url
I have this SQL DECLARE @url varchar(100) SET @url = 'http://mysite.com/%' SELECT [UserSessionSequenceID] ,[SiteID]
I have in my log some URLS like: http://www.mysite.com/mypage/?fb_xd_fragment= I want to redirect this
I have this link: http://mysite.com/subdirectory/something/stuff/index.php What regex would I be able to use that
For my site I have a RewriteRule that points the URL http://www.mysite.com/work to a
I have a dynamically created url: http://www.mysite.com/?id=1&title=Home (but really the id can be any

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.