Forum Moderators: phranque
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST}!^www\.MyDomain\.com
RewriteRule (.*) [MyDomain.com...] [R=301,L]
All other directories are fine, it's just the folder that protected via cPanel's method.
You might consider adding an exception to your rule set; Do not redirect if the request is for your secure page. Since the search engines can't spider password-protected pages, there's no dupe-content issue anyway.
This can be done with the addition of one more RewriteCond;
RewriteCond %{REQUEST_URI} !^/path_to_secure_page$
Jim
The page is not a "secure" page. It's just a page protected by cPanel's "Password Protect Directories" feature. (Nothing "sensitive" is on the page, it's just so customers will have a little privacy from SE's and the public regarding the details of their "Custom widget order". Then, they click a link on that page and go to a secure page). "Span" above said he doesn't have the problem, so apparently it's something in my 301 direct lines.
Are you saying that I can add this line to my .htaccess file and it will fix the problem?
RewriteCond %{REQUEST_URI}!^/path_to_secure_page$
Thanks.
What is happening is that mod_auth is triggered just before mod_rewrite gets the chance to rewrite your example.com to www.example.com.
So you have to send your customers the www.example.com URL or add Jim's RewriteCond to your 301 code. Adding that line will exclude your secure URL from being rewritten.
I had in my emails the non-www link for the custom order payments page, and when the link is clicked it goes to my 404 error page!
These are the links I referred to. In future, send the www link.
For right now, if the non-www link will resolve in the absence of the www redirect, then making an exception to the www redirect should allow your customers to gain access by clicking on the non-www link.
Jim