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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:59:38+00:00 2026-05-19T00:59:38+00:00

I have a script on my site (‘write-review.php’) that takes an optional url parameter

  • 0

I have a script on my site (‘write-review.php’) that takes an optional url parameter ‘site’. So server-side requests could be:

/reviews/write-review.php

or

/reviews/write-review.php?site=foo

I’m using .htaccess to create search engine friendly URLs and hide my php extensions, so that requests to this script are respectively rewritten as

/reviews/write-a-review/

or

/reviews/write-a-review/foo

I think having ‘foo’ in the URL may cause confusion for my users, so I’m trying to write an htaccess rewrite rule that removes ‘foo’ while still passing this variable to my script. Thus, a request to /reviews/write-a-review/foo would be rewritten as /reviews/write-a-review/ but write-review.php would be passed ‘foo’.

The rewrite rule I currently have in place is:

RewriteRule ^reviews/write-a-review/?$ reviews/write-review.php
RewriteRule ^reviews/write-a-review/([a-zA-Z0-9_-]+)/?$ reviews/write-review.php?site=$1

Is it even possible to do what I’ve described above? There are MANY questions on Stack Overflow that are similar to this, and I’ve read through at least a dozen, but I haven’t found a way to do this specifically.

Any help is really appreciated.

Thanks,

Chris

  • 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-19T00:59:39+00:00Added an answer on May 19, 2026 at 12:59 am

    Is it even possible to do what I’ve described above?

    No. To alter the actual URL the user inputs, you’d have to do a header redirect, during which you would lose foo.

    This is not possible, except maybe by using ridiculous technical tricks like storing foo in a session variable or something. I would not recommend going that route.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP script that retrieves list of urls from a site and
I have a php script on my site (users_online.php) that shows how many people
I have a script that runs every hour on my php site. In that
We have script http://site.com/ourscript.php How to add something like enter password block on that
I have a script on jquery that load some site in iframe using: $(#demo_frame).attr('src',
I have imported my database by script from live site to my local server.
I have a file hosting site that's using this script MFHS . I want
I have a custom accordion script that I'm trying to adapt for another site.
I have a web service site that is restful enabled, so other websites/ajax script
I have a system for a file hosting site which requires a PHP script

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.