LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-10-2010, 12:58 AM   #1
linux_bud
LQ Newbie
 
Registered: Nov 2009
Posts: 7

Rep: Reputation: 0
mod_rewite


Hi,

I have a query on mod_rewite/apache/.htaccess

It is like this:
Suppose a company have a website www.abc.com,when a user types in this URL in his browser he should get a login and passwd prompt say he enters username as user1 and some passwd, upon successful authentication he should get redirected to another url www.abc.com/user1...similary for user2 and user3...
mod_rewite is loaded htpsd.conf has "rewrite engine on" directive enabled...Could someone help me with the rewite rule? Or is any other change required?
 
Old 03-10-2010, 07:02 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 a .htaccess in the DocumentRoot of your server, like this:

Code:
RewriteEngine on

RewriteCond %{REMOTE_USER} ^[a-z].*
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^/* /%{REMOTE_USER}
If you don't want to use .htaccess, replace %{REMOTE_USER} with %{LA-U:REMOTE_USER} in httpd.conf

Regards

Last edited by bathory; 03-10-2010 at 09:12 AM.
 
  


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



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

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