LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-21-2011, 09:47 AM   #1
asifbasha
Member
 
Registered: Feb 2009
Posts: 98

Rep: Reputation: 15
htaccess rewrite rule


Hai to all

I am using fedora 15 system with apache server in my php development environment .. I am not an expert in htaccess rewrite rule. my request is i have to rewrite the below rule like this


from : www.xyz.com/test.php?&name=check&id=25

to : www.xyz.com/test.php/check

the name value and id value will change dynamically , because i am retrieving mysql row from id value .. and this rule should apply only for test.php

any idea will help me

thanks in advance to all ..

Last edited by asifbasha; 09-21-2011 at 09:49 AM.
 
Old 09-21-2011, 12:48 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

You may try the following:
Code:
RewriteEngine On
RewriteCond %{QUERY_STRING} ^&name=(.*)&id=(.*)
RewriteRule test.php(.*) /test.php/%1? [R]
Quote:
the name value and id value will change dynamically , because i am retrieving mysql row from id value
I don't see where the id value is involved, but if you need it in some manner you can use %2 for it

Regards
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
.htaccess rewrite issues crypted Linux - Server 2 12-12-2010 03:20 PM
need on rewrite rule help ravibhure Linux - Newbie 5 09-09-2010 01:03 PM
.htaccess rewrite problem skylimit123 Linux - Server 6 04-02-2010 11:42 AM
htaccess 301 rewrite BillKat Linux - Server 2 04-07-2009 12:54 PM
i need a rewrite rule!help arcow Linux - Enterprise 1 07-03-2007 05:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration