This web page has a redirect loop - apache

Alright so I tried forcing either www. or allowing without the www. . It wasn't working so I took it all out of the .htaccess file and re-uploaded. Now when I try to view the website I get the error message of:
This web page has a redirect loop
How long does this take to refresh and not display this error message anymore? I tried clearing my cookies and flushing my DNS. It's still there.
Thank you!

Maybe have a look at this previous question's answers: How long does it take for .htaccess changes to take effect?
Changes to .htaccess should take effect immediately. It might help to re-check the obvious things (that the file on the server is indeed the correct .htaccess, etc)
Apache's help page on the matter: http://httpd.apache.org/docs/2.2/configuring.html#htaccess

Related

config.php working while app_dev.php and app.php doesn't

I have a problem using Symfony2. I sent my website on my server, but as I said in the title, the website doesn't work.
In fact, when I try to access to the file config.php, it's working directly, but if I try to access to app_dev.php or app.php the webpage loads indefinitely and nothing comes.
That's happens only if set my IP address into app_dev.php for exemple. Otherwise I have:
You are not allowed to access this file. Check app_dev.php for more information.
which is normal, but I think it's important to report that.
I really don't know where it can comes from, so any help is welcome.
EDIT:
Finally it seems to comes from APC which is bugging, so I switch it off.

apache keeps old .htaccess settings (in rewriterule)

I am testing some basic .htaccess rewriterules and I am pretty sure that even after deleting a rule in .htaccess and saving the document, apache ignores it and acts like the rule was still there (only for earlier requested sites) - even after apache restart. It is driving me crazy, the behavior is really mad. Is there any apache cache which is about to be cleaned or the problem is elsewhere?
It's madness! Not really, it's just annoying.
When you set a redirect in Apache what you're doing is actually configuring headers that are passed to your browser. Your browser keeps a cache of 301 and 302 redirect headers (and other things like DNS) in the event you go back to those pages, so it can save you time. 301 redirects are supposed to be permanent (that's what you're indicating), so if there is no need for the browser to do something like perform a DNS lookup or visit a page based on a redirect, then it will cut corners and use the cache in order to provide you with a faster browsing experience.
You need to flush your browser's cache to prevent the store redirects from happening.
Additionally, you'll want to resubmit your page to Google (in the event it's on the web) in case they've crawled your site while the invalid headers existed.

mod_rewrite - Does Apache caches .htaccess rules? (still follow rules even after deleting the .htaccess file)

I was doing some tests with mod_rewrite in my wamp environment.
I tested a simple rule that I put at the root of one of my websites and asked it to redirect any request ending with index.php to localhost (there is no sense to it, just wanted to check the rule)
It worked, but after, any change I'd made to my .htaccess file rule was not reflected.
After a while I just decided to delete the .htaccess... well it's still doing redirection! I just don't understand it. Does Apache cache the rules or something (restarting services trough wamp menu didn't change anything)
(Don't ask for the exact rule I used, since I deleted the file, I don't think it's relevant anyway)
.htaccess files are processed each time a request comes through. It is possible that your browser cached the request being forwarded. Did you try it with httpfox or anything to see what the headers said?
Have you tried deleting the browser cache?

How long does it take for .htaccess changes to take effect?

I have added url rewrite rules to my .htaccess file. Should I see these changes working right away?
Changes to .htaccess are immediate and do not require a restart. Normally, if you aren't seeing what you expect from .htaccess changes, you have a syntax error and should check Apache's logs for some idea of what's going on.
If you use redirect 301, clear browser cache.
NVM found it.
The .htaccess files follow the same syntax as the main configuration
files. Since .htaccess files are read on every request, changes made
in these files take immediate effect.
Apparently, some servers only check .htaccess files periodically. I've found this to be the case w/ our AWS host.
My source is only a comment below the answer here, but it matches my experiences and others seem to agree.

Updating Files on Apache

I'm having trouble with my Apache Web Server. I have a folder (htdocs\images) where I have a number of images already in place. I can browse them and see them on my web server (and access them via HTML). I added a new image in there today, and went to browse to it, and it can't be found. I double and triple checked the path and everything. I even restarted Apache and that didn't seem to help.
I'm really confused as to what's going on here. Anybody have any suggestions?
Thank you.
Edit I just turned on the ability for the images directory to be listed, browsed to it (http://127.0.0.1/images/) and I was able to see all the previous images that were in the folder, but not the new one.
Turn directory indexes on for htdocs\images, remove (or move out of the way) any index.* files, and point your browser at http://yoursite/images/
That should give you a full listing of files in that directory. If the file you're looking for isn't there, then Apache is looking at a different directory than you think it is. You'll have to search your httpd.conf for clues -- DocumentRoot, Alias, AliasMatch, Redirect, RedirectMatch, RewriteRule -- there are probably dozens of apache directives that could be causing the web server to get its documents from somewhere other than where you think it's looking.
make sure the caSE and spelling are 100% correct.
There is not magic in programming (some may disagree:), so look for silly errors. Wrong server? Case of your letters? Wrong extension?
There's a chance it could be due to the cookies stored on your device. I would delete all cookies to the website you're working on before you refresh again