What would cause RewriteRule not to work?

Hello Experts,

I have a really frustrating dilema I am facing here.  I have two almost completely identical websites, I know they are almost completely identical because all I did was copy the files and the database from one site into the domain of the other and update any references to the domain.  Even the domains are almost exactly the same, just one is a .com and the other is a .org.  Each site sits on its own server, and a minor modification was made to one server's .htaccess to allow for password protection (since this is a development site).

Well, as I said, the .htaccess files are identical with the exception of the updated domain name and the password protection, but for some reason, only some of the rewrite rules and conditions seem to be working.  The others don't seem to be taking any effect.

What could cause only some rewrite rules to work, especially since they are proven to work on the other server?  I've already checked the apache configuration files and there are no rewrite rules there, but apache is properly configured to use rewrite rules.
LVL 17
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Turn on logging for rewrite rules.  That will give you some clue.  The most likely reason is that the original condition pattern is not being met (most likely because it has some domain component in it).
OmniUnlimitedAuthor Commented:
OK, have patience with me because for the most part, this is all new to me.  I did not write the rewrite rules, nor do I know how to do it, nor how the files are supposed to be configured for it other than stuff I found online.  I read in the Apache documentation that I can turn rewrite rule logging on, but that i should be careful as to how high I set it because it can dramatically slow down the processes.

Question 1: How high a level do you recommend I set RewriteLogLevel?

Question 2: Once it starts logging, where on the server can I find the log?

Thanks again.
Steve BinkCommented:
The RewriteLog is very useful, but it can also generate a lot of information, and you will see a minor performance hit on each request.  You should definitely not keep it on in production environments.  Turning it on momentarily for debugging rules is fine, though.

When you need the log for debugging, set the RewriteLogLevel at 9.  The RewriteLog directive determines where the log file will be generated.

Note that the RewriteLog and RewriteLogLevel directives must be placed in the server's main conf file, or in the site's VirtualHost container.  They will not function within htaccess files.  

If you can turn on your log, and post a single attempt of a rule not working, we can assist in debugging.  Posting the full set rules you are using will be helpful also.
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

OmniUnlimitedAuthor Commented:
Hi, sorry it took so long to get back to you.  I had to try and generate the log at a time when there was least traffic on the production site.  Even when I did that, the file (for only a couple of minutes of activation) exceeded 4 MB in size.  I am aghast.  I activated the logs, accessed one page that I knew I was having differences in resulting url's on between the two sites, then deactivated the log.  The one on the development site (the one with no traffic) produced a file 1.67 MB in size.

I'm sorry, but I don't have the time to go over these logs line by line, especially considering the fact that 1) I do not know how to interpret them, and 2) I do not know precisely what it is I am looking for.

The .htaccess file has dozens of rewrite rules and conditions within it.  What is the most time efficient method of locating my problem?
Steve BinkCommented:
I am not aware of any shortcuts to this process.  You need to identify which rule is not applying, and why.  The only place you'll find this information is in the rewrite log, and there is not going to be a big, bold sign pointing the way.   Even worse, there could be multiple rules failing in some way, or multiple rules just not playing well together.

The easiest way to do this on a production server is to trigger the failure from a specific client IP, then isolate just that IP from the rewrite log.  Depending on how many rules your request is testing, you could still end up with a sizable log to go through, but it should be much better than the megabyte range you are currently seeing.
post the rewrite rules and any information you have regarding which rules do and do not work.

it may be easy for us to figure out by simply seeing the file, or we can point out more precise usage of the rewrite log. btw, log level 2 is reasonably easy to understand and provides decent debug info in most cases. it is difficult to work with the rewrite log on a production server
OmniUnlimitedAuthor Commented:
Unfortunately, the check the log methods described were not practical for me.  I ended up calling technical support on my server and describing the fact that the site that operates perfectly fine on one server will not on the other.  The technician was able to correctly ascertain that there were differences in the setup of the two servers, specifically, the installation of a CPanel on the server giving the problems.  We replaced the CPanel with a Plesk system (as we have it on our other server) and the site works fine.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
OmniUnlimitedAuthor Commented:
Sorry, none of the suggestions offered provided a practical solution to my problem.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.