LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-25-2011, 08:42 AM   #1
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 239

Rep: Reputation: 30
apache rewrite rule


I want to apply below rewrite rule in apache

Source Destination
/products/touchapps.html /content/dotcom/products
/touchapps.html


directory wide Rewrite? E.g. everything under /products/touchapps/* goes to the destination
 
Old 09-25-2011, 09:17 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,

Quote:
E.g. everything under /products/touchapps/* goes to the destination
I guess you mean everything under /products. If that's the case, then you can use:
Code:
RewriteEngine On

RewriteCond %{REQUEST_URI} ^/products
RewriteRule products/(.*) /content/dotcom/products/$1
Regards
 
Old 09-25-2011, 02:03 PM   #3
bryan641
Member
 
Registered: Mar 2011
Location: Ohio, USA
Distribution: Debian Stretch
Posts: 43

Rep: Reputation: 14
I think an mod_alias is more efficient than mod_rewrite. Something like:

Alias /products /var/www/content/dotcom/products

Where "/var/www" represents whatever is your document root, since "Alias" can be used to access folders outside the server's document root.

--Bryan
 
  


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
Need help with apache Rewrite Rule? your_shadow03 Linux - Newbie 1 01-21-2010 07:12 AM
Linux Apache Rewrite Rule jon_k Linux - Software 1 06-10-2009 02:09 AM
Subdomains with Apache 2.2.3 - vhost or rewrite rule? Serapis Linux - Server 8 01-25-2008 04:28 AM
Apache rewrite rule help kinetik Linux - Software 1 11-05-2007 11:18 AM
Help me make this rewrite rule in Apache ganninu Linux - General 8 01-07-2004 08:30 AM

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

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