modRewrite - server redirect instead of http redirect

Posted on 2004-11-03
Last Modified: 2010-03-04

Hi all

I have the following rewriterule that will obviously redirect from to

ReWriteRule ^thisPage     cgi-bin/food.cgi?Wish=FFFF00500080000002171957 [L]

I think it's possible to redirect the user on the server so that the URL remains as  I believe this will mean search engine spiders will index the search engine friendly URL rather than the redirected URL.

What do I need to add/change?

Question by:codeEater
    LVL 5

    Expert Comment

    Remove [L] from end of your RewriteRule
    LVL 5

    Expert Comment

    or you have another rewrite rule after this?

    Author Comment


    yeah I have series of these rules, like this:

    ReWriteRule ^thisPage            cgi-bin/food.cgi?Wish=FFFF00500080000002171957 [L]
    ReWriteRule ^AnotherPage      cgi-bin/food.cgi?Wish=FFFF00500081000002171957 [L]
    ReWriteRule ^somPage           cgi-bin/food.cgi?Wish=FFFF00500082000002171957 [L]
    ReWriteRule ^DifferentPage     cgi-bin/food.cgi?Wish=FFFF00500083000002171957 [L]

    Any ideas mrielf? or anyone...
    LVL 5

    Assisted Solution


    But if you don't use [R] (as you don't) then redirection is silent...

    You have links to "cgi-bin/food.cgi?Wish=FFFF00500080000002171957" on your pages?

    Author Comment


    Yeah the web pages have links such as

    These rewrite rules are just for Spiders so they will be submitted to search engines.

    I was seeing the URL actually replaced in the browser address bar rather than having the original link displayed i.e

    Sorry this is new to me, I'm learning fast.
    LVL 5

    Accepted Solution

    You can substitute the links on your webpage? If not, then you can create alternativ webpage for robots only, which contains only links to /thispage /otherpage /somepage etc...
    And you can tell robots not to follow links if it serverd by cgi-bin/food.cgi (just inserting to head section a meta tag)

    You can read more about from here:


    Author Comment

    Oops the assisted answer should be the accepted.

    I split the points so others landing on this solution will take notice of the very helpful link you posted.

    Thanks mrielf

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
    In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video discusses moving either the default database or any database to a new volume.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now