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

The Archive Base Latest Questions

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

I am trying to rewrite a URL using .htaccess. I am running on Apache

  • 0

I am trying to rewrite a URL using .htaccess. I am running on Apache version 2.2.15.

Contents of .htaccess:

RewriteEngine on
RewriteRule cars/(.*) cars/member_page.php?user=$1
RewriteRule cars/(.*)/ cars/member_page.php?user=$1

Contents of member_page.php:

<?php
echo $_GET[user];
?>

URL entered into browser:

http://www.mydomain.com/cars/user1

The browser outputs the string “member_page.php” instead of “user1”

How do I make it output the contents of (.*) from the original URL.

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

    The problem with this format:

    RewriteEngine on
    RewriteRule cars/(.*) cars/member_page.php?user=$1 [L]
    RewriteRule cars/(.*)/ cars/member_page.php?user=$1 [L]
    

    Turns out that I was rewriting cars/whatever to cars/member_page.php. This creates the problem of rewriting to the same directory that the rewrite is on.

    So

    cars/user1
    

    was rewritten to

    cars/member_page.php/user=member_page.php
    

    It was rewritten twice using the content from the second rewrite as the final information. The solution is to move member_page.php to a different directory.

    RewriteEngine on
    RewriteRule cars/(.*) memberscars/member_page.php?user=$1 [L]
    RewriteRule cars/(.*)/ memberscars/member_page.php?user=$1 [L]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Apache on a Red Hat server, I'm trying to rewrite the URL of
I am trying to rewrite in htaccess mobile.domain.com/mobile/function into mobile.domain.com/function I thought the below
Below is my deployment descriptor. I'm using Spring MVC, but I've got a url
I would like to use RewriteRules in .htaccess to achieve particular url rewriting, but
So I have a webpage that queries some data based on this parameter search.php?state=AL
I've been experiementing with URL rewriting in IIS 6 and 7. On IIS 6,
I'm trying to create a mod_rewrite rule that will drop any .htm that gets
I am trying to get mod_rewrite to work with my site but for some
Still trying to learn the basic of jquery so in the weekend I started
I'm trying to parse an xml file from a website. Let's say the website

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.