301 Redirect Question for trailing slash & index.php
-
1. Can you show me how to do a redirect for forhttp://www.exercisebiology.com to http://www.exercisebiology.com/ I want to add the trailing slash.
2. Also how to redirect from http://www.exercisebiology.com/in...
to http://www.exercisebiology.com/.
When I tried to redirect the index.php last time, I couldn't login to the forums. Everytime when someone tries to login to my forums, it takes them the to the home page. I did it through the hostgator CP. I am thinking someone could help me here.
Thank you so much!
-
I asked my hostagtor customer service and he said I cannot add the trailing sash since it will create a infinite loop.
And I added the index.php through the hostagtor control panel where it has a form which you can fill. And it automatically writes the code.
I am just confused about the trailing slash code in the article.
-
**When I tried to redirect the index.php last time, I couldn't login to the forums. Everytime when someone tries to login to my forums, it takes them the to the home page. **
The first thing you should clearly understand is altering your htaccess file is not something which should be done except by professionals who understand the Regex language used and how htaccess works. If you make an error your website can become instantly unavailable, or worse you can open up a security gap in your site and it may be exploited at a much later time.
Additionally, not only the code matters but exactly where the code is placed within the htaccess file. I would recommend contacting your developer or web host for assistance. With that above understood, here are links to two articles which share instructions on how to achieve the results you desire:
Add trailing slash: http://enarion.net/web/htaccess/trailing-slash/
Redirect index.php to root: http://www.askapache.com/htaccess/redirect-index-blog-root.html
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Google indexing staging / development site that is redirected...
Hi Moz Fans! - Please help. We had a acme.stagingdomain.com while a site was in development, when it went live it redirected (302) to acmeprofessionalservices.com (real names redacted!!) no known external links to staging site although staging site url has been emailed from Google Apps(!!!) now found that staging site is in the index even though it redirects to the proper public site. and some (but not all) of the pages are in the index too. They all redirect to the proper public site when visited. It is convenient to have a redirect from the staging site to the new one for the team, Chrome etc. remember frequently visited sites. Be a shame to lose that. Yes, these pages can be removed using webmaster tools.
Technical SEO | | mozroadjan
But how did they get in the index to start with? And if we're building a new site, and a customer has an existing site is there a danger of duplicate content etc. penalties caused by the staging site? We had a similar incident recently when a PDF that was not linked anywhere on the site appeared in the index. The link had been emailed through Google Apps, and visited in Chrome, but that was it. So 3 questions. Why is the staging site still in the index despite the redirects? How did they get in the index in the first place? Will the new staging site affect the rank of the existing site, eg. duplicate content penalties?0 -
When to use mod rewrite / canonical / 301 redirect
Hello, I have taken over the management of a site which has a big problem with duplicate content. The duplicate content is caused by two things: Upper and lower case urls e.g: www.mysite.com/blog and www.mysite.com/Blog The other reason is the use of product filters / pagination which mean you can get to the same 'page' via different filters. The filters generate separate URLs. http://www.mysite.com/casestudy
Technical SEO | | Barques-Design
http://www.mysite.com/casestudy/filter?page=1
http://www.mysite.com/casestudy/filter?solution=0&page=1
http://www.mysite.com/casestudy?page=1
http://www.cpio.co.uk/casestudy/filter?solution=0" Am I right to assume that for the case sensitive URLs I should use a 301 redirect because I only want the lower page to be shown? For the issue with dynamic URLs should we implement a mod-rewrite and 301 to one page? Any advice would be greatly appreciated.
Mat0 -
Suddenly Many 301 Redirects captured by SEOMOZ
On April the 7th SeoMOZ captured 6000 301 redirect on my site, but I cant seem to understand how SEOMOZ finds these links Example http://www.iphonegadget.dk/dk/apple-tilbeh-r-36/ipad-tilbeh-r-219/bilholder-239/index-2-4a.html Makes a 301 Redirect to the following page beneath SEOMOZ says http://www.iphonegadget.dk/dk/apple-tilbeh-r-36/ipad-tilbeh-r-219/bilholder-239/index-2.html The weird thing is that both urls work, but if i browse my site in a normal matter this link will never be created i that way. The -4a in the end os the link is not the normal link structure on the site and has never been like that before. So how does SEOMOZ Create that link? http://www.iphonegadget.dk/dk/apple-tilbeh-r-36/ipad-tilbeh-r-219/bilholder-239/index-2-4a.html Also google only has the right one that are this one beneath http://www.iphonegadget.dk/dk/apple-tilbeh-r-36/ipad-tilbeh-r-219/bilholder-239/index-2.html People would normal come to the category with this url http://www.iphonegadget.dk/dk/apple-tilbeh-r-36/ipad-tilbeh-r-219/bilholder-239/ And page 2 would be http://www.iphonegadget.dk/dk/apple-tilbeh-r-36/ipad-tilbeh-r-219/bilholder-239/index-2.html AND NOT http://www.iphonegadget.dk/dk/apple-tilbeh-r-36/ipad-tilbeh-r-219/bilholder-239/index-2-4a.html Can anyone find out what is going on?
Technical SEO | | noerdar0 -
Index.php duplicate content
Hi, new here. Im looking for some help with htaccess file. index.php is showing duplicate content errors with: mysite.com/index.php mysite.com/ mysite.com ive managed to use the following code to remove the www part of the url: IfModule mod_rewrite.c>
Technical SEO | | klsdnflksdnvl
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L] but how can i redirect the mysite.com/index.php and mysite.com/ to mysite.com. Please help0 -
Google Webmaster redirect vs 301 redirect
OK assuming a client's website has the right tracking script (hopefully analytics isn't effected by this issue), ... what happens if the htaccess file has a 301 redirect to the www-address, but within Google Webmaster Tools, the address chosen to crawl by Google is the non-www address? How will Google handle and which address takes precedence in this situation? _Cindy
Technical SEO | | CeCeBar0 -
Multiple Domains, Same IP address, redirecting to preferred domain (301) -site is still indexed under wrong domains
Due to acquisitions over time and the merging of many microsites into one major site, we currently have 20+ TLD's pointing to the same IP address as our "preferred domain:" for our consolidated website http://goo.gl/gH33w. They are all set up as 301 redirects on apache - including both the www and non www versions. When we launched this consolidated website, (April 2010) we accidentally left the settings of our site open to accept any of our domains on the same IP. This was later fixed but unfortunately Google indexed our site under multiple of these URL's (ignoring the redirects) using the same content from our main website but swapping out the domain. We added some additional redirects on apache to redirect these individual pages pages indexed under the wrong domain to the same page under our main domain http://goo.gl/gH33w. This seemed to help resolve the issue and moved hundreds of pages off the index. However, in December of 2010 we made significant changes in our external dns for our ip addresses and now since December, we see pages indexed under these redirecting domains on the rise again. If you do a search query of : site:laboratoryid.com you will see a few hundred examples of pages indexed under the wrong domain. When you click on the link, it does redirect to the same page but under the preferred domain. So the redirect is working and has been confirmed as 301. But for some reason Google continues to crawl our site and index under this incorrect domains. Why is this? Is there a setting we are missing? These domain level and page level redirects should be decreasing the pages being indexed under the wrong domain but it appears it is doing the reverse. All of these old domains currently point to our production IP address where are preferred domain is also pointing. Could this be the issue? None of the pages indexed today are from the old version of these sites. They only seem to be the new content from the new site but not under the preferred domain. Any insight would be much appreciated because we have tried many things without success to get this resolved.
Technical SEO | | sboelter0 -
Will Google index a 301 redirect for a new site?
So here is the problem... We have setup a 301redirect for our clients website. When you search the clients name it comes up with the old .co.uk website. We have made this redirect to the new .com website. However on the SERPs when it shows the .co.uk it shows the old title pages which currently say 'Holding Page'. When you click on that link it takes you to the fully functioning .com website. My question is, will the title tags in the SERPs which show the .co.uk update to the new ones from the .com? I'm thinking it will be just a case of Google catching up on things and it will sort itself out eventually. If anyone could help I would REALLY appreciate it. Thanks Chris
Technical SEO | | Weerdboil0 -
301 redirects inside sitemaps
I am in the process of trying to get google to follow a large number of old links on site A to site B. Currently I have 301 redirects as well a cross domain canonical tags in place. My issue is that Google is not following the links from site A to site B since the links no longer exist in site A. I went ahead and added the old links from site A into site A's sitemap. Unfortunately Google is returning this message inside webmaster tools: When we tested a sample of URLs from your Sitemap, we found that some URLs redirect to other locations. We recommend that your Sitemap contain URLs that point to the final destination (the redirect target) instead of redirecting to another URL. However I do not understand how adding the redirected links from site B to the sitemap in site A will remove the old links. Obviously Google can see the 301 redirect and the canonical tag but this isn't defined in the sitemap as a direct correlation between site A and B. Am I missing something here?
Technical SEO | | jmsobe0