LinuxQuestions.org
Visit Jeremy's Blog.
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, 05: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, 09:22 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,214
Blog Entries: 1

Rep: Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067Reputation: 2067
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 12:52 PM
.htaccess question mlapl1 Linux - Newbie 1 06-05-2009 03:54 PM
.htaccess question Seventh Linux - Security 1 07-23-2006 12:31 AM
.htaccess question kidestranged Linux - Software 0 03-08-2005 12:57 PM
htaccess question Legolas Linux - Security 0 08-24-2001 02:14 PM

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

All times are GMT -5. The time now is 12:14 AM.

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