![]() |
HTACCESS problem - loop error
Hey guys
Im stuck with a problem...i'll explain the issue. I published my website and the path was something like www.example.com/example.php and it was indexed by google. I have now redone my directories so the path is now www.example.com/uk/example.php So when a visitor goes to example.com it should go to example.com/uk/ As google has already indexed the old path, im assuming I need a 301 redirect to phase out the old path and introduce the new path...correct me if im wrong? Ive tried the following basic 301 redirect...but it returns a 'indefinate loop'. Code:
Redirect 301 / http://www.example.com/uk/Please someone let me know what im doing wrong...ive spent hours searching and found nothing! :( Thanks! |
try this;
Code:
Options +FollowSymLinks |
Thanks for that...
I tried it and for some reason the page doesnt seem to be loading correctly. I went to www.webpagetest.org and tested the website. Basically i have a subdomain (ie. images.example.com which is located at example.com/images). The htaccess seems to be causing the website to load whatever is in the subdomain twice (ie. once from images.example.com and again from example.com/images). Any ideas to how to fix this? |
Hello,
Can you update whats the error you are getting to help you better. |
Theres no actual error. Heres whats happening:
Scripts are located at 'http://script.example.com/script.js' whose actual path is 'http://www.example.com/script/script.js'. According to webtestpage.org, 'http://script.example.com/script.js' is being loaded aswell as 'http://www.example.com/uk/script/script.js', the latter doesnt exist. So i assume the htaccess above rewrites all urls under example.com to example.com/uk/. That is why when the page loads it doesnt look/behave correctly. So what I suppose I need is to force (if possible) the htaccess file to just work in the root and not in the subdirectories? Is this possible? Or is there anything else I can do...maybe force the script directory to always reference the subdomain?? Hope this is clear, let me know if it isnt. Thanks! |
Update:
I found some code on the net which excludes sub domains from the rewriterule: Code:
RewriteCond %{HTTP_HOST} ^scripts\.example\.comWhat is going on here? Anyone know who to resolve this? Please.... |
Solved! For anyone interested, I missed a line of code (RewriteBase /) out.
Heres what I eventually used: Code:
Options +FollowSymLinks |
| All times are GMT +1. The time now is 06:11 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.