Forum Moderators: phranque
Below is the .htaccess setup that was included in the help.txt file:
<Files widgets>
SetHandler application/x-httpd-php
</Files>
RewriteEngine On
RewriteBase /
AddType text/xml .xslt
RewriteCond %{REQUEST_URI}!widgets\.php
RewriteRule ^widgets(.*)$ widgets.php$1
Can anyone tell me what the problem is?
As always, thanks in advance for your replies :-)
I think this one has been left alone, because there is nothing glaringly wrong.
I would comment out everything except:
RewriteEngine on
RewriteCond %{REQUEST_URI}!widgets\.php
RewriteRule ^widgets(.*)$ widgets.php$1
and make this small change:
RewriteEngine on
RewriteCond %{REQUEST_URI}!widgets\.php
RewriteRule ^widgets(.*)$ /widgets.php$1
See if this works, if it does, you'll know the problem is in one of the other lines... If not, post again, and I'll have another look.
Hope this helps.
Justin
What was the error?
What do your server logs say?
Has any rewrite ever worked?
Is mod_rewrite installed and is your server httpd.conf file set to AllowOverride File Info, or All
Is your .htaccess in the position to correctly catch and redirect the request to the new location?
Your php or any combination of these (and possibly others) could be the source of the problem.
Justin
1. All rules should have [L] (Unless you are really sure otherwise)
RewriteRule ^widgets(.*)$ /widgets.php$1 [L]
2. If you don't want to go through logs to try to find out why/where the rule is sending you to get a 404, you could try:
RewriteRule ^widgets(.*)$ /widgets.php$1 [R,L]
The [L] indicates last rule, stop processing.
The 2nd rule with [R,L] will execute an external redirect (visible in the browser). When I run into 404's, or other issues I often switch to an external redirect, so I can see where the rule is trying to send me. Then, after I have the problem solved, I remove the R and switch back to an internal redirect. (This is often much faster/easier than reading logs, for me anyway.)
Sorry I missed the [L] before, should know better.
Justin