Forum Moderators: phranque
It seems that whenever you have
Rewrite Engine On
in your .htaccess, and FPSE are enabled, a 403 error is produced after you submit a form (the form never gets submitted).
The only place I have found that gives a working solution, is found here: [msfrontpage.net...]
However that solution doesn't seem to work, and many articles on the site are outdated. (The author dicusses background fixes for NS 3/4 in one of his posts :P )
I understand where you are coming from regarding FP- but I can make a fully functioning FP form is about 10 seconds. If you have any suggestions for something that can be done in say a few minutes, I am open to suggestions. All I use FP for are the forms as they take so little time to create something very detailed. Plus, I don't have to update any software or worry about holes.
Hopefully someone will have some info about this later on in the week.
#first, correct the www if necessary
RewriteCond %{HTTP_HOST} .
RewriteCond %{REQUEST_URI} !^/_vti_bin [NC]
RewriteCond %{HTTP_HOST} !^www\.my-domain-name-here\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301]
#then, rewrite secure folder 1
RewriteCond %{REQUEST_URI} !^/_vti_bin [NC]
RewriteCond %{REQUEST_URI} !^/helpdesk/admin/parser.php [NC]
RewriteCond %{REQUEST_URI} ^/helpdesk/ [NC]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
#then, rewrite secure folder 2
RewriteCond %{REQUEST_URI} !^/_vti_bin [NC]
RewriteCond %{REQUEST_URI} ^/modernbill/ [NC]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L] #then, rewrite secure folder 3
RewriteCond %{REQUEST_URI} !^/_vti_bin [NC]
RewriteCond %{REQUEST_URI} ^/Secure-Order/ [NC]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
#then, rewrite slashes for secure folder 1
RewriteCond %{REQUEST_URI} !^/_vti_bin [NC]
RewriteCond %{REQUEST_URI} ^/helpdesk [NC]
RewriteCond %{REQUEST_URI} !^/helpdesk/ [NC]
RewriteRule ^(.*)$ https://www.example.com/$1/ [R=301,L]
#then, rewrite slashes for secure folder 2
RewriteCond %{REQUEST_URI} !^/_vti_bin [NC]
RewriteCond %{REQUEST_URI} ^/modernbill [NC]
RewriteCond %{REQUEST_URI} !^/modernbill/ [NC]
RewriteRule ^(.*)$ https://www.example.com/$1/ [R=301,L]
#then, rewrite slashes for secure folder 3
RewriteCond %{REQUEST_URI} !^/_vti_bin [NC]
RewriteCond %{REQUEST_URI} ^/Secure-Folder [NC]
RewriteCond %{REQUEST_URI} !^/Secure-Folder/ [NC]
RewriteRule ^(.*)$ https://www.example.com/$1/ [R=301,L]
[edited by: jdMorgan at 12:20 am (utc) on May 24, 2005]
[edit reason] Examplified. [/edit]
I think my problem is similar, maybe slightly different. I don't use FP forms, however I do use frontpage to manage and design my site. Everytime I change the htaccess from the www root directory, I cannot sign into Frontpage. This is the code I want in the htaccess file:
_______________________________________________________
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^(.*)$ [example.com...] [L,R=301]
_______________________________________________________
However with this piece of code, I can't sign in FP :(
Is there a fix for this?
[edited by: jdMorgan at 11:53 pm (utc) on May 23, 2005]
[edit reason] Examplified. [/edit]
Is this code for use in .htaccess? I'm asking because there are several major code-speed-up opportunities here.
#turn on the engine
RewriteEngine On
#first, correct the www if necessary
RewriteCond %{HTTP_HOST} .
RewriteCond %{REQUEST_URI} !^/_vti_bin [NC]
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301]
#then, rewrite secure folder 1
RewriteCond %{REQUEST_URI} !^/_vti_bin [NC]
RewriteCond %{REQUEST_URI} !^/helpdesk/admin/parser.php [NC]
RewriteCond %{REQUEST_URI} ^/helpdesk/ [NC]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
#then, rewrite secure folder 2
RewriteCond %{REQUEST_URI} !^/_vti_bin [NC]
RewriteCond %{REQUEST_URI} ^/modernbill/ [NC]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L] #then, rewrite secure folder 3
RewriteCond %{REQUEST_URI} !^/_vti_bin [NC]
RewriteCond %{REQUEST_URI} ^/Secure-Order/ [NC]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
#then, rewrite slashes for secure folder 1
RewriteCond %{REQUEST_URI} !^/_vti_bin [NC]
RewriteCond %{REQUEST_URI} ^/helpdesk [NC]
RewriteCond %{REQUEST_URI} !^/helpdesk/ [NC]
RewriteRule ^(.*)$ https://www.example.com/$1/ [R=301,L]
#then, rewrite slashes for secure folder 2
RewriteCond %{REQUEST_URI} !^/_vti_bin [NC]
RewriteCond %{REQUEST_URI} ^/modernbill [NC]
RewriteCond %{REQUEST_URI} !^/modernbill/ [NC]
RewriteRule ^(.*)$ https://www.example.com/$1/ [R=301,L]
#then, rewrite slashes for secure folder 3
RewriteCond %{REQUEST_URI} !^/_vti_bin [NC]
RewriteCond %{REQUEST_URI} ^/Secure-Folder [NC]
RewriteCond %{REQUEST_URI} !^/Secure-Folder/ [NC]
RewriteRule ^(.*)$ https://www.example.com/$1/ [R=301,L]
# -FrontPage-
IndexIgnore .htaccess */.?* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName www.example.com
AuthUserFile /home/username/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/username/public_html/_vti_pvt/service.grp
This code still produces the error as well.
[edited by: jdMorgan at 12:22 am (utc) on May 24, 2005]
[edit reason] De-linked. [/edit]
If it's not clear, I am guessing in this thread. I don't use FP extensions myself. At the point where the guessing becomes useless, please let me know.
Jim
#turn on the engine
RewriteEngine On
#first, correct the www if necessary
RewriteCond %{HTTP_HOST} .
RewriteCond %{REQUEST_URI}!^/_vti_ [NC]
RewriteCond %{HTTP_HOST}!^www\.example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301]
#then, rewrite secure folder 1
RewriteCond %{REQUEST_URI}!^/_vti_ [NC]
RewriteCond %{REQUEST_URI}!^/helpdesk/admin/parser.php [NC]
RewriteCond %{REQUEST_URI} ^/helpdesk/ [NC]
RewriteCond %{SERVER_PORT}!^443$
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
#then, rewrite secure folder 2
RewriteCond %{REQUEST_URI}!^/_vti_ [NC]
RewriteCond %{REQUEST_URI} ^/modernbill/ [NC]
RewriteCond %{SERVER_PORT}!^443$
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L] #then, rewrite secure folder 3
RewriteCond %{REQUEST_URI}!^/_vti_ [NC]
RewriteCond %{REQUEST_URI} ^/Secure-Order/ [NC]
RewriteCond %{SERVER_PORT}!^443$
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]
#then, rewrite slashes for secure folder 1
RewriteCond %{REQUEST_URI}!^/_vti_ [NC]
RewriteCond %{REQUEST_URI} ^/helpdesk [NC]
RewriteCond %{REQUEST_URI}!^/helpdesk/ [NC]
RewriteRule ^(.*)$ https://www.example.com/$1/ [R=301,L]
#then, rewrite slashes for secure folder 2
RewriteCond %{REQUEST_URI}!^/_vti_ [NC]
RewriteCond %{REQUEST_URI} ^/modernbill [NC]
RewriteCond %{REQUEST_URI}!^/modernbill/ [NC]
RewriteRule ^(.*)$ https://www.example.com/$1/ [R=301,L]
#then, rewrite slashes for secure folder 3
RewriteCond %{REQUEST_URI}!^/_vti_ [NC]
RewriteCond %{REQUEST_URI} ^/Secure-Folder [NC]
RewriteCond %{REQUEST_URI}!^/Secure-Folder/ [NC]
RewriteRule ^(.*)$ https://www.example.com/$1/ [R=301,L]
# -FrontPage-
IndexIgnore .htaccess */.?* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName www.example.com
AuthUserFile /home/username/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/username/public_html/_vti_pvt/service.grp
It still shoots back a 403: http://www[.]example.com/_vti_bin/shtml.exe/form.htm
[edited by: engine at 10:43 am (utc) on Aug. 26, 2005]
[edit reason] delinked [/edit]
Have you reviewed the code above to exclude /_vti_bin?
I tried this code:
RewriteEngine on
RewriteCond %{REQUEST_URI}!^/_vti_bin [NC]
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
But still no luck, I can't sign into frontpage.
Any suggestions?
[edited by: engine at 11:13 am (utc) on Aug. 26, 2005]
[edit reason] delinked [/edit]
[added] I'd also encourage you two to compare notes. [/added]
Jim
Are there any other directories or subdirectories that might need to be excluded?
I tried this, but this didnt even do what I wanted it to do in the first place..but is this even on the right track?:
RewriteEngine on
RewriteCond %{REQUEST_URI}!^/_vti_bin [NC]
RewriteCond %{REQUEST_URI}!^/_borders [NC]
RewriteCond %{REQUEST_URI}!^/_fpclass [NC]
RewriteCond %{REQUEST_URI}!^/_private [NC]
RewriteCond %{REQUEST_URI}!^/_themes [NC]
RewriteCond %{REQUEST_URI}!^/_vti_cnf [NC]
RewriteCond %{REQUEST_URI}!^/_vti_log [NC]
RewriteCond %{REQUEST_URI}!^/_vti_pvt [NC]
RewriteCond %{REQUEST_URI}!^/_vti_txt [NC]
RewriteCond %{REQUEST_URI}!^/_vti_inf.html [NC]
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
I am assuming that these are some of the frontpage directories. This code does not work.
[edited by: engine at 11:14 am (utc) on Aug. 26, 2005]
[edit reason] delinked [/edit]
You don't have to list each and every directory and file... For example, the second RewriteCond below takes care of anything that starts with /_vti_ and so covers lots of directories and files with only one line of code. Also, you should not need the [NC] flag unless you have some incorrect-case links on your site. The idea is to make the code as lean and mean as possible, so you don't slow down your server under heavy load.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteCond %{REQUEST_URI} !^/_vti_
RewriteCond %{REQUEST_URI} !^/_borders
RewriteCond %{REQUEST_URI} !^/_fpclass
RewriteCond %{REQUEST_URI} !^/_private
RewriteCond %{REQUEST_URI} !^/_themes
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
This is a very strange problem. It's a wonder that there are not more discussions of solutions for it on the Web.
Jim
However, I cant login to Frontpage with the optimized code..unless of course i take the code out. Yes this is so weird, this is why I never even used hotlink protection, because its inconvenient to disable the code every time I want to use frontpage to design my site. If we figure this out, I can also use hotlink finally :) But this is really important, because I need the non-www to be redirected big time. I may have lost my serps in Google due to this! And I like frontpage!
Merlin...did I miss any subcategories that Frontpage uses? I'm not too good with this htaccess stuff...I actually just learned what it did today.
Here is a test that I believe will make a huge difference. A blank .htaccess file with RewriteRules On and nothing else listed, will produce a 403 error on forms, search, various other FPSE components, as well not allow the publish using FrontPage.
I am going to setup a test account on my server, just to make sure everything is correctly configured. Be back in 10 minutes to report my findings. Also Jim, if you have any ideas how to make my .htaccess code perform faster, that would be great :)
Here is the simple .htaccess code I am using:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteCond %{REQUEST_URI}!^/_vti_
RewriteCond %{REQUEST_URI}!^/_borders
RewriteCond %{REQUEST_URI}!^/_fpclass
RewriteCond %{REQUEST_URI}!^/_private
RewriteCond %{REQUEST_URI}!^/_themes
RewriteCond %{REQUEST_URI}!^/testing
RewriteRule ^(.*)$ http://example.com/$1 [L,R=301] # -FrontPage-
IndexIgnore .htaccess */.?* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName wwWebmasterWorldd.info
AuthUserFile /home/mbwdinf/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/mbwdinf/public_html/_vti_pvt/service.grp
I tried the code in public_html as well as public_html/testing, and then tried it with both and it did not work....
This really is a pain in the ass, hopefully someone will have a clue about this. :)
[edited by: jdMorgan at 3:22 am (utc) on Aug. 26, 2005]
[edit reason] Removed unlinked URL per TOS. [/edit]
However, if all it takes to break FrontPage is to add "RewriteEngine on" to a blank .htaccess, these two points are moot. Obviously, it is not the RewriteRules which break FrontPage extensions, but rather the invokation of mod_rewrite. As a result, no number of exclusions to the RewriteRules, is likely to help.
The key to solving this problem is just that - to avoid complicating the problem until the basic cause is found. After that, we can discuss optimizing the code and other side issues. But for now, the central mystery is, "Why does enabling the RewriteEngine cause a problem?"
The only thing that comes to mind is an inheritance issue. And the only thing I can think of to try is to put something like:
RewriteEngine off
If so, try:
RewriteEngine on
RewriteEngine off
RewriteEngine on
RewriteRule ^foo\.html$ /any_static_file_that_exists.html [L]
RewriteEngine off
The 'RewriteEngine off' directive is not normally needed in .htaccess. But it *may* affect the way that code in .htaccess files below the current directory behaves if 'RewriteOptions Inherit' has been set.
Again, sorry I can't be of more help -- These are just guesses at a way to proceed. The more closely the problem can be defined, the more likely that a solution may be found.
Jim
RewriteEngine On
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST}!^www\.example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301]
RewriteEngine Off# -FrontPage-
IndexIgnore .htaccess */.?* *~ *# */HEADER* */README* */_vti*
<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName wwWebmasterWorldd.info
AuthUserFile /home/mbwdinf/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/mbwdinf/public_html/_vti_pvt/service.grp
[edited by: engine at 11:15 am (utc) on Aug. 26, 2005]
[edit reason] delinked [/edit]
I gave him a call and left a message, hopefully he will respond. His suggestion of using the Options SymLinksIfOwnerMatch did not work, I also tried Options +SymLinksIfOwnerMatch which also did not work. The end result was exactly the same :/
I'll keep looking and updating this thread. We have tried many things so far, and documented all of it. Hopefullt someone will come along with some more suggestions.
---------
Chris finally replied saying he didn't quite remember everything he did, but played a bit with the httpd.conf for Apache, and said something he did got it to work.
However, once you nail down the filenames that need to be excluded from all rewrites, it's a simple matter to put a rule like
RewriteRule ^_vti_bin - [L]
Again, this is a minor point and I'd like to stay on-topic. Perhaps you could get your 'contact' to send you a copy of his httpd.conf file with all 'private stuff' removed for dissection and analysis...
Jim
Something like this is what I would need, right?
<VirtualHost *>
ServerName example.com
..the rest
Redirect 301 / http://www.example.com/
</VirtualHost> If the above didn't loop, it would redirect only example.com and not example.com/another-folder
If there is code that I can use to add a www before a example.com, as well as a way to make certain folders change to https, then I would love to use that! I just didn't think you could do this in the apache config file.
I am just so "shocked" that no one else has this problem. No one uses Frontpage anymore? It just seems that it would be a more common problem but I guess not.
Merlin, lets work together to try to figure this out,
[edited by: engine at 11:17 am (utc) on Aug. 26, 2005]