LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-09-2009, 07:58 PM   #1
jon_k
Member
 
Registered: Jul 2003
Location: Fort Worth, Texas
Distribution: Mepis Linux 2004
Posts: 547

Rep: Reputation: 30
Linux Apache Rewrite Rule


Interesting issue here.

I have this under a vhost along with many other rewritecond's that work fine.

<code>
RewriteEngine on
rewritecond %{query_string} page_id=20 [nc]
rewriterule ^(.*)$ http://newurl.com [r=301,nc]
</code>

This doesn't seem to work after reloading Apache's config. According to documentation, this should work; any ideas?
 
Old 06-10-2009, 02:09 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,159
Blog Entries: 1

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
It works indeed.
How do you test it? You should use something like: http://vhost.com/index.html?page_id=20 and see if it redirects you to http://newurl.com.
 
  


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
Apache rewrite rule help - dynamic url to static page DukeLeto Linux - Software 3 11-12-2008 11:26 AM
apache rewrite rule to lighttpd's. error!!! gavin2u Linux - Server 0 08-12-2008 12:18 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 - Software

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