views:

62

answers:

2
    CheckSpelling On

    RewriteEngine   on
    RewriteCond     %{HTTP_HOST}                      ^([^.]+)\.site\.com$
    RewriteCond     /home/%1/                          -d
    RewriteRule     ^(.+)                              %{HTTP_HOST}$1
    RewriteRule     ^([^.]+)\.site\.com/media/(.*)     /home/$1/data/media/$2
    RewriteRule     ^([^.]+)\.site\.com/(.*)           /home/$1/www/$2

The checkspelling on (mod_speling) works fine when its www.site.com...... But it does not work when the Rewrites take place. for example there is a /home/test/www/index.html file. If you do test.site.com/INDEX.html it will not fix to test.site.com/index.html but if you do www.site.com/INDEX.html (there is no /home/www/ folder) it will fix it to www.site.com/index.html.

It seems like it processes through the mod_rewrite first and if it uses rewrite...it doesnt go through checkspelling. I have tried loaded the modules in different orders with no luck.

A: 

mod_speling can't look for spelling alternatives that go through mod_rewrite rules. It should work if you use use a redirect [R], but it looks like you want to hide the actual directories.

You might consider a custom 404 instead of mod_speling.

Jeremy Stein
Strange. I had a setup that was working 6 months ago, I forgot how or what I did. Since then I have lost 50% of what I had customized ;[
Brian
A: 

mod_speling and mod_rewrite operate in the same phase when rewrite is used in per-directory context ( or htaccess). This phase runs all participating modules, not the first to take any action.

rewrite in per-directory always acts as if it has the [PT] flag. If your rewrites are not in per-directory context, just add the [PT] flag and use URI's instead of filenames in your substitutions will probably get them interoperating.

covener