English 中文(简体)
mod_speling & mod_rewrite to work together?
原标题:
    CheckSpelling On

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

The CheckSpelling On (mod_speling) works fine when it’s www.example.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.example.com/INDEX.html it will not fix to test.example.com/index.html but if you do www.example.com/INDEX.html (there is no /home/www/ folder) it will fix it to www.example.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.

问题回答

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.

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.





相关问题
Using SimplePie with CodeIgniter and XAMPP

I am using CodeIgniter 1.7.2 with XAMPP 1.7.2 on a Windows computer. I am trying to make use of SimplePie. I followed all the instructions I could find: a copy of simplepie.inc is in my applications/...

Multiple Sites with common files

I have developed over 50 sites that all use the exact same files other than CSS and IMAGES, I currently duplicate the files each time I create a new site and upload different css and images. What ...

http server validation

I finish a litle http server, writing from scratch. I would like to be sure that my imlementation is conforme to the HTTP specifications. W3C give us tools for HTML/XML conformance, but i see nothing ...

热门标签