LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 07-12-2017, 07:51 AM   #1
gaurvrishi
Member
 
Registered: Apr 2012
Posts: 62

Rep: Reputation: Disabled
Smile Apache rewrite rule


I am trying to write apache rewrite rule and not able to understand from where i should start.

My requirement is that if somebody type

http://www.abc.com/folder1/folder2/folder2/test.pdf then it should redirect to http://www.abc.com/bin/server/status...lder2/test.pdf

This will be any file test.pdf, it can be test.txt but the path /folder2/folder2/ will be same.

As i did google and found little help:

RewriteCond %{HTTP_HOST} ^www\.abc\.com$
RewriteRule ^folder1/folder2/folder2/([A-Za-z0-9]+)(.*) http://www.abc.com/bin/server/status? [L,R=301]

but don't know how to use uri=/folder2/folder2/ on realtime

Last edited by gaurvrishi; 07-12-2017 at 07:53 AM.
 
Old 07-12-2017, 08:14 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate of http://www.linuxquestions.org/questi...le-4175609370/

Please continue to seek your answers with your original thread. Posting a duplicate only will further confuse the question.
 
  


Closed Thread

Tags
rewrite, rewritecond



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
Apache rewrite rule gaurvrishi Linux - Newbie 7 07-12-2017 12:57 PM
[SOLVED] rewrite rule for apache linux_kung_fu Linux - General 2 07-04-2012 10:35 AM
apache rewrite rule sunlinux Linux - Newbie 5 11-14-2011 07:06 AM
apache rewrite rule sunlinux Linux - Server 2 09-25-2011 02:03 PM
Need help with apache Rewrite Rule? your_shadow03 Linux - Newbie 1 01-21-2010 07:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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