Forum Moderators: phranque
I have my rewrite rule as:
<Directory /var/www/quasicms>
RewriteEngine On
RewriteRule ^.*AccountHome/design/[0-9]+.*?$ core/classes/imageHandler.class.php?id=$1
</Directory>
on my local machine.
However, when I translate this to my webserver, it will not rewrite. Is the Directory tag very important with Rewrite rules? This is what I have on the server (much more complicated).
DocumentRoot /var/www/batchpcb/devel
RewriteEngine On
#allow old batch product links ..
RewriteCond %{QUERY_STRING} ^products_id=([0-9]+)(&check=.*)$
RewriteRule product_info\.php /index.php/Products/%1%2 [L]
# RewriteRule ^.*AccountHome/design/[0-9]+.*?$ core/classes/imageHandler.class.php?id=$1
<Directory /var/www/batchpcb/devel>
RewriteRule ^.*AccountHome/design/[0-9]+.*?$ core/classes/imageHandler.class.php?id=$1
Options SymLinksIfOwnerMatch
AllowOverride None
Order Deny,Allow
Deny from all
Allow from 204.188.103.98 71.218.121.241 63.224.70.252
</Directory>
I have other directories that have Deny from all without any allows... could this be my issue? I have tested the regex to know that it works correctly, I feel like this has to be a location problem or a flag problem?
I am not sure there would ever be a relationship attributed to your newness and the simplicity of the answer. :)
This rewrite could never work. At no point does any pattern matching lead to the $1 backreference being populated:
RewriteRule ^.*AccountHome/design/[0-9]+.*?$ core/classes/imageHandler.class.php?id=$1 As well as fixing that, the .* patterns and the anchoring are both unnecessary, and you must add the [L] flag to the rule.
. Is the Directory tag very important with Rewrite rules?
However, when I translate this to my webserver
RewriteEngine on into your server-side <directory>-section. Hence mod_rewrite's fixup hook will decline.