Welcome Guest, Not a member yet? Register   Sign In
.htaccess rewrite rules
#1

[eluser]obiron2[/eluser]
Guys,

My .htaccess file currently looks like this
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /ci/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
    # If we don't have mod_rewrite installed, all 404's
    # can be sent to index.php, and everything works as normal.
    # Submitted by: ElliotHaughin

    ErrorDocument 404 /index.php
</IfModule>
Which I believe is the default configuration for most CI installations.

I have a controller called "scanned" with a method of "scanned" that takes a single argument "$code"

The URL should be www.mysite.com/scanned/scanned/CODE

Due to an oversight, documentation has gone out with www.mysite/scanned/CODE (i.e. missing the second "scanned"

I want to use mod_rewrite to add in the missing "scanned" but I can't work out the syntax.

I have tried
Code:
RewriteRule ^scanned/(.*)$ scanned/scanned/$1 [L]
and I have tried it before and after the index.php rewrite and with and without the [L]ast flag.

What am I doing wrong and can you explain to me what rewrite logic I have messed up


Messages In This Thread
.htaccess rewrite rules - by El Forum - 07-18-2012, 06:26 AM
.htaccess rewrite rules - by El Forum - 07-18-2012, 02:40 PM
.htaccess rewrite rules - by El Forum - 07-19-2012, 06:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB