Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm not an Apache expert but need to make a small change to a web server. We are introducing a "jump page" URL that is different from a primary URL (for tracking reasons).

/productA/index.html
/productA/jump_index.html

Basically i want to log that jump_index.html was requested and then return index.html. I don't want the client to wait 8 seconds or so for a redirect.

How should we be handling this? Simply symlink (or alias) the file in the filesystem? Use mod_alias Alias Match (if so how exactly)? something better still?

Edit: mod_rewrite in httpd.conf:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_METHOD} ^TRACE
    RewriteRule .* - [F]
</IfModule>
share|improve this question
    
Redirects don't actually take 8 seconds. That delay you see on some pages is added on purpose so that you have time to read the message. –  Wyzard Sep 1 '12 at 5:50

2 Answers 2

Just use an HTTP redirect, e. g. with RedirectPermanent or more dynamically with RedirectMatch:

RedirectPermanent /productA/jump_index.html http://example.com/productA/index.html
RedirectMatch permanent \/(product.*)\/jump_index\.html http://example.com/$1/index.html
share|improve this answer

you could use a simple redirect header

<META HTTP-EQUIV="Refresh" CONTENT="0; URL=index.html">

for example

share|improve this answer
    
there is a slight delay, of course, but nowhere near 8 seconds. you could use mod_rewrite for something much faster. –  cpbills May 13 '10 at 18:41
    
RewriteEngine On and RewriteRule jump_index.html index.html in .htaccess for example. i do not know if jump_index.html and index.html will show in your access.log, though, for tracking. –  cpbills May 13 '10 at 18:50
    
so rather than use .htaccess where would i put this RewriteRule in in httpd.conf (see above). Immediately before </IfModule> or before RewriteRule .* - [F] ? somewhere else entirely? –  Meltemi May 13 '10 at 19:35
    
perhaps after it. i'm not an expert with mod_rewrite, sadly. –  cpbills May 13 '10 at 20:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.