Posts Tagged ‘Apache’

Tip: Skip all RewriteRules on a sub-request in Apache

To have Apache mod_rewrite skip processing all rules during a sub-request you could add a NS (no sub-request) flag to each rule. Or, you could just make this the first rule:

RewriteCond %{IS_SUBREQ} true
RewriteRule .* – [L]

How to use URL rewriting to control access to www

Having your site respond with content to requests on both domain.tld and www.domain.tld can give the appearance to search engines that your site has duplicate content, so don’t do it. Here’s how:

How to run a Symfony site without the .htaccess file

I recently wrote a tip about how to overcome issues when working with mod_rewrite, PHP_SELF, and configuration settings within the main server or virtual host context as is recommended in the Apache documentation on Per-directory Rewrites (scroll down to the notes). This post will explain the specific changes needed to do this for the Symfony [...]

Tip: Use PHP_SELF and mod_rewrite without using .htaccess

Want to use your favorite PHP framework without it’s .htaccess file by moving those settings into your httpd.conf but it’s not quite working out? This is probably because some of those settings in the .htaccess file are rewrites and the PHP framework you are using uses a front controller that relies on the PHP_SELF server [...]

Subscribe to RSS Feed Follow me on Twitter!