LinuxQuestions.org
Help answer threads with 0 replies.
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


Reply
  Search this Thread
Old 09-12-2012, 07:22 PM   #1
mohitvad
Member
 
Registered: Feb 2010
Posts: 34

Rep: Reputation: 0
rewrite rule in apache


Hi,

Can you please help me to write the syntax for rewrite rule in apache to get the below results? it should be for all subdomains and all .act files on the server

http://abc.test.com/jack.act
should redirect
http://abc.test.com/jack.php


Thanks,
Mohit

Last edited by mohitvad; 09-12-2012 at 07:37 PM.
 
Old 09-12-2012, 08:05 PM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Do you have access to the Apache .conf files?

else, it's .htaccess time. See http://corz.org/serv/tricks/htaccess2.php

Last edited by Habitual; 09-12-2012 at 08:09 PM.
 
Old 09-13-2012, 12:04 AM   #3
jsaravana87
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Blog Entries: 5

Rep: Reputation: Disabled
Hi
You can rewrite using mod_Proxy.First of all check whether you had enabled the module


#httpd -M
LoadModule proxy_module bin/mod_proxy.so
LoadModule proxy_http_module bin/mod_proxy_http.so

ProxyPass /jack.act http://abc.test.com/jack.php
ProxyPassReverse /jack.act http://abc.test.com/jack.php
 
Old 09-14-2012, 03:18 PM   #4
mohitvad
Member
 
Registered: Feb 2010
Posts: 34

Original Poster
Rep: Reputation: 0
I used following rewrite rules in my httpd.conf and it solved the prob

For http

RewriteEngine On
RewriteRule ^/(.*).act(.*) /$1.php$2 [P,R=301]

For https

RewriteEngine On
RewriteRule ^/(.*).act(.*) /$1.php$2 [L,R=301]
 
  


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
[SOLVED] rewrite rule for apache linux_kung_fu Linux - General 2 07-04-2012 10:35 AM
apache rewrite rule sunlinux Linux - Newbie 10 11-11-2011 05:01 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
Apache rewrite rule help kinetik Linux - Software 1 11-05-2007 11:18 AM

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

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