HELP! RewriteEngine Rules issue

Posted on 2011-10-23
Last Modified: 2012-05-12
I am writing some rewrite rules, but I am having issue with one of them. This is what I have:

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{HTTP_HOST} ^$ [NC]
RewriteRule ^(.*)$$1 [R=301,L]

RewriteRule ^r/(.*)$ index.php?redirect=$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ index.php?code=$1 [NC,L]

All rules work, except this one: RewriteRule ^r/(.*)$ index.php?redirect=$1 [L]
Instead I get a 404 not found, for example with this url: I get The requested URL /r/ was not found on this server.

Anyone know why is that happening?
Question by:ApOG
    LVL 13

    Accepted Solution

    It's a known bug

    I think you should provide the redirect url without 'http://'

    Author Closing Comment

    Yup! It was exactly that...

    Thanks dsmile, always helpful!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Suggested Solutions

    In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting ( to http…
    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…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    779 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

    11 Experts available now in Live!

    Get 1:1 Help Now