LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 02-27-2009, 06:52 PM   #1
entz
Member
 
Registered: Mar 2007
Location: Milky Way , Planet Earth!
Distribution: Opensuse
Posts: 453
Blog Entries: 3

Rep: Reputation: 40
Rewrite Rules to Preserve Original URL


HI ,

let's first have a look at this

http://www.easymodrewrite.com/guide-syntax

ok , so i've my rewrite rules setup , everything is fine and dandy
but i'm want some extra which why i'm doing this in the first place.

I don't want the server send back any redirect header codes , i just want a straight response as if the browser had sent the final url after rewriting

basically , i want the browser to keep displaying let's say

domain.com/article/24 while the server does the internal redirection
and not redirect the broswer url to article/index.php?id=24

So what extras should i put there to achieve this ?

did i miss something or what?

Thank you
 
Old 02-28-2009, 10:05 AM   #2
entz
Member
 
Registered: Mar 2007
Location: Milky Way , Planet Earth!
Distribution: Opensuse
Posts: 453

Original Poster
Blog Entries: 3

Rep: Reputation: 40
Ok , it seems that this thread has not got enough attention to answer this question of mine.

maybe because i didn't explain clearly what i want so here is the whole thing formulated in simpler words:

i have mod_rewrite in httpd server configured and is up and running
consider this:

Code:
RewriteRule old.html new.html
which basically broadly matches 'old.html' and sent a redirect http header 3xx to browser , something a moved page..etc

now what i want , is that instead of externally redirecting the browser
to the new url , i want the server to internally do the mapping without
annoying the user agent with redirects and crap like that.

maybe because i wanna keep the backend url secret ?? who knows why ! LOL

so how am i supposed to accomplish this ?

Cheers
 
Old 03-23-2009, 04:16 PM   #3
trevelluk
Member
 
Registered: Nov 2003
Location: Bristol, UK
Distribution: Debian Lenny, Gentoo (at work)
Posts: 388

Rep: Reputation: 32
As I understand it, then the normal behaviour of a RewriteRule is exactly what you want, and you need to add the [R] flag to send the redirect header to the browser.

The example that you give, of rewriting old.html to new.html should, I think, behave exactly as you want. Is that the exact line you're using?
 
  


Reply

Tags
apache, modrewrite



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
ReWrite Rules dereko Linux - Software 0 04-30-2008 10:54 AM
URL rewrite help needed rino.caldelli Linux - Server 4 09-28-2007 04:19 PM
sendmail forwarded messages to preserve original sender paranoid times Linux - Software 1 06-27-2007 02:24 PM
apache url rewrite gallew Linux - Server 0 08-25-2006 03:54 AM
Need help with Apache rewrite rules?? latino Programming 0 12-24-2004 02:09 AM

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

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