Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 09-12-2012, 08:22 PM   #1
Registered: Feb 2010
Posts: 34

Rep: Reputation: 0
rewrite rule in apache


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
should redirect


Last edited by mohitvad; 09-12-2012 at 08:37 PM.
Old 09-12-2012, 09:05 PM   #2
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

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

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

#httpd -M
LoadModule proxy_module bin/
LoadModule proxy_http_module bin/

ProxyPass /jack.act
ProxyPassReverse /jack.act
Old 09-14-2012, 04:18 PM   #4
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]


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 11:35 AM
apache rewrite rule sunlinux Linux - Newbie 10 11-11-2011 06:01 AM
apache rewrite rule sunlinux Linux - Server 2 09-25-2011 03:03 PM
Need help with apache Rewrite Rule? your_shadow03 Linux - Newbie 1 01-21-2010 08:12 AM
Apache rewrite rule help kinetik Linux - Software 1 11-05-2007 12:18 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:00 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration