Chrissi

Just to further cement this, if I add the redirect to the public/_resources/.htaccess file on the fresh SS install, it does work.

Chrissi

So… this is a SilverStripe issue. Is it safe for me to modify the public/resources/.htaccess file? I am feeling really unsure about that since it does seem to be auto-generated, it’s .gitignored and I never created it.

Chrissi

I can do public/resources, but that’s to be expected since there’s no conflict with the _resources directory.

Chrissi

I just tried a the same rule in public/.htaccess on a fresh silverstripe install with literally no customization. It seems that the resources directory has moved to _resources, so I modified the rule to be _resouces so that the same conflict is caused. On this fresh install, I also cannot create a redirect from a URL starting with public/_resources by modifying the public/.htaccess file.

Chrissi
  1. RewriteEngine On
  2. RewriteCond %{QUERY_STRING} ^aID=985$ [NC]
  3. RewriteRule ^resources/news_2013.php? / [L,R=301]

That should redirect /public/resources/news_2013.php?aID=985, right? It does not. But if I add the same thing to public/resources/.htaccess (modifying the rule to remove resources), it does work.

Chrissi

I put it at the top of public/.htaccess and it does not work.

Chrissi

We use the SS root .htaccess for most redirects and they’ve been working fine. Just not this one.

Chrissi

I tried above ### SILVERSTRIPE START ### and below ### SILVERSTRIPE END ###. Should I be putting the redirect inside it someplace?

Chrissi

There are 3 .htaccess files here, and the only one that will allow me to redirect this URL is the one inside public/resources .

Chrissi

I guess I mean SS root rather than webroot. I guess public is webroot then. I just mean that the SS root .htaccess doesn’t work for this particular redirect, nor does the public .htaccess.