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

  • Home
  • SEARCH
  • 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 8603203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:16:09+00:00 2026-06-12T02:16:09+00:00

<h1><a href=profile.php?id=’ . $id . ‘ target=_self>’ . $name. ‘</a></h1> The above is the

  • 0
<h1><a href="profile.php?id=' . $id . '" target="_self">' . $name. '</a></h1>

The above is the reference which points to my profile1.php file. This file is called index.php . It currently displays the urls as this:

http://www.domain.com/interact/profile1.php?id=36

I have tried implementing the .htaccess file to rewrite the url. I tried many combinations and most of them gave a 500 error and some did not rewrite the url.
This is the .htaccess file which I use, it does not make the url to change.

I want the url to look like http://www.domain.com/interact/profile/36

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ profile1.php/$1 [QSA,L]
</IfModule>

I know this is a very basic question but I seem to stuck in it and have read basic tutorials but am not able to implement it properly.

The files index.php ,profile1.php and .htaccess are in folder named interact.

Tell me any changes required in php or .htaccess files.

  • 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-12T02:16:10+00:00Added an answer on June 12, 2026 at 2:16 am

    It currently displays the urls as this: http://www.domain.com/interact/profile1.php?id=36

    …

    I want the url to look like http://www.domain.com/interact/profile/36

    Step 1:

    Change your content to have links like this:

    <h1><a href="profile/' . $id . '" target="_self">' . $name. '</a></h1>
    

    This way, when you click on a link the URL that will appear in the URL address bar is will look like: http://www.domain.com/interact/profile/36

    Step 2:

    Then you need to use these rules to internally change it back:

    RewriteEngine On
    RewriteBase /interact/
    RewriteRule ^profile/([0-9]*) profile1.php?id=$1 [L,QSA]
    

    In order to point any external links, like google index bots to the new URLs, you’ll need to add these as well:

    RewriteCond %{THE_REQUEST} ^(GET|HEAD)\ /interact/profile1\.php\?id=([0-9]*)
    RewriteRule ^ http://www.domain.com/interact/profile/%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 this line of code: <a href=# id=profilelink name=profilelink value=<?php echo $id./.$block_record;?> onClick=return
I have this line of code: <a href=# id=profilelink name=link2 onClick=viewornot(<?php echo $freechat_id ?>)><?php
let's say I have this: link_to Profile, profile_path(@profile) # => <a href=/profiles/1>Profile</a> But if
Should hyperlinks in a Facebook app be relative i.e. <a href=profile.php>link</a> or absolute i.e.
I have developed a php file called profile.php that displays the current user's profile.But,
I've got this HTML: <font> <b> <a href=profile/user>user</a> </b> <font>message</font> </font> I know the
I have this href link with text either attivo or non attivo User can
I have this href defined in my markup: foreach (Car car in Model.Cars) {
Why W3C Validator showing parsing error on this. I selected CSS3 profile also from
I'm trying to achieve this url on my users profile in a cleaner way:

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.