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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:01:01+00:00 2026-06-10T03:01:01+00:00

I have a php file lets say test.php?x=1 with .htaccess i can rewrite the

  • 0

I have a php file lets say test.php?x=1 with .htaccess i can rewrite the url.

Here is my .htaccess

RewriteEngine on
RewriteRule ^some-page_([0-9]+)_(.+)?$ test.php?x=$1 [L]

Normally i can write whatever i want write after x on the url.
Now here is the thing that i want to make;
In the test.php file there is a variable $name.
I want to write that variable into .htaccess thus i would like to make make link below

localhost/some-page_1_SOME-TEXT-COMING-FROM-VARIABLE

How could i do that? Thank you.

  • 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-10T03:01:03+00:00Added an answer on June 10, 2026 at 3:01 am
    RewriteEngine on
    RewriteRule ^some-page_([0-9]+)_(.+)?$ test.php?x=$1&name=$2 [L]
    RewriteRule ^some-page_([0-9]+)?$ test.php?x=$1 [L]
    

    That second line with allow you to just have localhost/some-page_1 work as well.

    The above will, or should, rewrite the first line below into the bottom URL:

    localhost/some-page_1_SOME-TEXT-COMING-FROM-VARIABLE
    localhost/some-page.php?id=1&name=SOME-TEXT-COMING-FROM-VARIABLE
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a php file which has some variables like $name1, $name2... How can
Let's say I have a php file, test.php with 2 functions: test1() and test2().
Let's say I have a test.html file with some example content: <table> <tr> <td>'Test'</td>
I have a php file that show the friends requests, lets say there are
Well lets say I have this follow code in my htaccess file, Options +FollowSymlinks
Lets say I have a plain text file example.txt and I have a PHP
Lets say I have the following piece of start in a PHP file: /**
I have a web server which returns an XML file. Lets say http://www.foo.bar/foo.php?wantXML=1 How
Lets say I have some pdf files stored on my server and I only
Hello I have a jQuery function that will send to a php file some

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.