LinuxQuestions.org
Help answer threads with 0 replies.
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 03-07-2011, 04:39 AM   #1
hebeles
Member
 
Registered: Feb 2010
Location: Amsterdam
Posts: 110

Rep: Reputation: 0
htaccess question


I apologize for the inconvenience.

I would like to ask a question

my php files.

index.php?pg=work
index.php?pg=me
index.php?pg=contact


I would like to appear that way htaccess

http://test.edu/?pg=work
http://test.edu/?pg=me
http://test.edu/?pg=contact

htaccess code for it is?

Best Wishes,

ps: my english basic, sorry.
 
Old 03-07-2011, 08:22 AM   #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 can use mod_rewrite for this. Put in a .htaccess the following:
Code:
RewriteEngine On

RewriteCond %{QUERY_STRING} ^pg=(.*)$
RewriteRule ^index.php(.*)$ http://test.edu/?pg=%1 [L]
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 question comptech520 Linux - Newbie 18 11-20-2009 11:52 AM
.htaccess question mlapl1 Linux - Newbie 1 06-05-2009 02:54 PM
.htaccess question Seventh Linux - Security 1 07-22-2006 11:31 PM
.htaccess question kidestranged Linux - Software 0 03-08-2005 11:57 AM
htaccess question Legolas Linux - Security 0 08-24-2001 01:14 PM

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

All times are GMT -5. The time now is 05:16 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