Is it bad to have /index.php at the end of a uri?
-
Is it bad for SEO if traffic is directed to "http://www.example.com/someuri/index.php" instead of "http://www.example.com/someuri/" and would it be works setting up a redirect rule at htaccess level?
-
Yes bad for both. You now have the name of a file acting as the name of a folder.
As mentioned above - kill the use of index.php as your index "file" - just end in a slash.
I know php treats these as routes/queries that then produce a page, but it can get things all messed up real quick.
-
Oops thanks for all you answers, but what i should have said is: Is having "/index.php/" half way through the URI like so
"http://www.example.com/someuri/index.php/more_uri/"
bad for SEO/UX?
To clarify if one searched on Google for more_uri and everything else was equal would the index.php in the middle of that URI be damaging to the ranking?
Sorry about that
-
Whilst I don't think the index.php will have a direct impact on the SEO of your website it could easily have an indirect impact.
As CleverPhD rightly points out it is a pain in the *** to remember and type that sort of URL.
Not only for yourself but also for other websites and customers.
The impact this has is hard to quantify... If I'm a site in your niche and want to link to you does this put me off? What if I link to the wrong site?
Beyond that ending in index isn't as nice a user experience as just ending at the page name and ultimately its my belief that if you do whats best for the user you'll get good results from google.
-
Correct - the duplicate issue is what will hurt you. Whatever you go with, make sure the other variants 301 redirect to the "true" page.
-
OK thanks, so index.php won't effect the SEO results. But not redirecting it, as both /index.php and / work correctly and go to the same php file, will result in the same content being registered twice by Google I'm guessing?
-
It is not "bad", although typical style would be that you can drop it as the extra characters are not needed and nobody likes extra typing - just ask Mr. Twitter. He used brevity to become a billionaire! Hmm .. I wish we could get Moz points for alliteration.
What is key is that you are consistent in your use of it. If you want to use /index.php then go for it. Just make sure every time you link to that URL in your menus or in articles when you Twiddle it of Farcebook it, you include the /index.php at the end as you do not want to have duplicate URLs for the same page. I would also setup 301 redirects so that the / only version redirects to the index.php version.
All of that said, you are going to find that after the 104th time of Twiddling that URL, you will say, "Gee, it sure is a pain to type all those extra characters." You will also find that when people are going to share your URLs they may have a tendency to drop the index.php as again, it is extra work. If you have the redirect in place, you will be ok, but I say, why have you and everyone else do all that extra work to start with. Just start with the URL ending in the slash and stay with that. Have all other versions of the index page (index.php, index.htm or even a non slashed version, etc) 301 redirect to the URL that ends in a /.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
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
-
Having a Subfolder/Subdirectory With a Different Design Than the Root Domain
Hi Everyone, I was wondering what Google thinks about having a subfolder/subdirectory with a different design than the root domain. So let's say we have MacroCorp Inc. which has been around for decades. MacroCorp has tens of thousands of backlinks and a couple thousand referring domains from quality sites in its industry and news sites. MacroCorp Inc. spins off one of its products into a new company called MicroCorp Inc., which makes CoolProduct. The new website for this company is CoolProduct.MacroCorp.com (a subdomain) which has very few backlinks and referring domains. To help MicroCorp rank better, both companies agree to place the MicroCorp content at MacroCorp.com/CoolProduct/. The root domain (MacroCorp.com) links to the subfolder from its navigation and MicroCorp does the same, but the MacroCorp.com/CoolProduct/ subfolder has an entirely different design than the root domain. Will MacroCorp.com/CoolProduct/ be crawled, indexed, and rank better as both companies think it would? Or would Google still treat the subfolder like a subdomain or even a separate root domain in this case? Are there any studies, documentation, or links to good or bad examples of this practice? When LinkedIn purchased Lynda.com, for instance, what if they kept the https://www.lynda.com/ design as is and placed it at https://www.linkedin.com/learning/. Would the pre-purchase (yellow/black design) https://www.linkedin.com/learning/ rank any worse than it does now with the root domain (LinkedIn) aligned design? Thanks! Andy
Web Design | | AndyRCWRCM1 -
Bing Indexation and handling of X-ROBOTS tag or AngularJS
Hi MozCommunity, I have been tearing my hair out trying to figure out why BING wont index a test site we're running. We're in the midst of upgrading one of our sites from archaic technology and infrastructure to a fully responsive version.
Web Design | | AU-SEO
This new site is a fully AngularJS driven site. There's currently over 2 million pages and as we're developing the new site in the backend, we would like to test out the tech with Google and Bing. We're looking at a pre-render option to be able to create static HTML snapshots of the pages that we care about the most and will be available on the sitemap.xml.gz However, with 3 completely static HTML control pages established, where we had a page with no robots metatag on the page, one with the robots NOINDEX metatag in the head section and one with a dynamic header (X-ROBOTS meta) on a third page with the NOINDEX directive as well. We expected the one without the meta tag to at least get indexed along with the homepage of the test site. In addition to those 3 control pages, we had 3 pages where we had an internal search results page with the dynamic NOINDEX header. A listing page with no such header and the homepage with no such header. With Google, the correct indexation occured with only 3 pages being indexed, being the homepage, the listing page and the control page without the metatag. However, with BING, there's nothing. No page indexed at all. Not even the flat static HTML page without any robots directive. I have a valid sitemap.xml file and a robots.txt directive open to all engines across all pages yet, nothing. I used the fetch as Bingbot tool, the SEO analyzer Tool and the Preview Page Tool within Bing Webmaster Tools, and they all show a preview of the requested pages. Including the ones with the dynamic header asking it not to index those pages. I'm stumped. I don't know what to do next to understand if BING can accurately process dynamic headers or AngularJS content. Upon checking BWT, there's definitely been crawl activity since it marked against the XML sitemap as successful and put a 4 next to the number of crawled pages. Still no result when running a site: command though. Google responded perfectly and understood exactly which pages to index and crawl. Anyone else used dynamic headers or AngularJS that might be able to chime in perhaps with running similar tests? Thanks in advance for your assistance....0 -
Website removed from Bing and Yahoo index
Hi, are website servicemanualrepairs.com was removed from Bing and Yahoo index, I emailed Bing via Webmaster tools they first said it was Backlinks I did look via at the inbound links tool to analyze the site's Backlinks I did find 20 links and used the Disavow tool, they said "I'm afraid but after careful and thorough investigation, your site still did not meet the Bing and Microsoft guidelines You may also refer to the things to avoid section of the Webmaster Guidelines for additional information. As an effect, the site is still blocked and it cannot be lifted" the website was in Bing and Yahoo index for 3 Years and only after the 20 Backlinks were added to the site it was de-index any help would be greatly appreciated Thanks
Web Design | | vista5211 -
Redirects Not Working / Issue with Duplicate Page Titles
Hi all We are being penalised on Webmaster Tools and Crawl Diagnostics for duplicate page titles and I'm not sure how to fix it.We recently switched from HTTP to HTTPS, but when we first switched over, we accidentally set a permanent redirect from HTTPS to HTTP for a week or so(!).We now have a permanent redirect going the other way, HTTP to HTTPS, and we also have canonical tags in place to redirect to HTTPS.Unfortunately, it seems that because of this short time with the permanent redirect the wrong way round, Google is confused as sees our http and https sites as duplicate content.Is there any way to get Google to recognise this new (correct) permanent redirect and completely forget the old (incorrect) one?Any ideas welcome!
Web Design | | HireSpace0 -
Google tag manager on blocked beta site - will it phone home to Google and cause site to get indexed?
We want to develop a beta site, in a directory with the robots.txt blocking bots. We want to include the Google Tag Manager tags and event layer tracking code on this beta site. My question is that by including the Google Tag Manager code, that phones home to Google, will it cause Google to index this beta site when we don't want it indexed?
Web Design | | CFSSEO0 -
Are wordpress themes like from themeforest bad?
Hi to all. Ok so as I read around the internet I see a lot of people who dislike theme forest and using their themes. I have a them from them, the Avada theme. Ok so they have made a TON of money. But would so many people buy the theme if it was that bad? Going forward, my question is, are wordpress themes a bad thing to do? I feel like its peer pressure to switch to a framework like Genesis. There are so many people who state that a framework and child theme is the way to go. But I am using this avada theme and having under 2.5 sec load times. A lot of people say the code is bloated and is horrible. I understand this and got a cache plugin that makes a huge difference. But I do want to learn and I do want to approach websites in a positive way. So if you have any thoughts on themes, please tell me your thoughts. I am no developer, so they seem to work, but is it at a price? Like bad seo and serps? Thank you chris
Web Design | | asbchris0 -
Anyone migrated a site from PHP into ASP? Anyone migrated into Sitecore?
We have a network of websites in Linux-based PHP and we may be switching them over to ASP.NET and using SiteCore CMS. Right now, we don't have a CMS. We would also be switching from using file extension www.site.com/file.php to no extensions www.site.com/file/ therefore altering our directory structure. We are aware of the potential impacts to traffic of the initial migration, but are now more curious about SiteCore CMS and SEO, performance and indexation/crawlability. Has anyone made this move before or considered making it? Can you offer any success stories, horror stories?
Web Design | | Eric_edvisors0 -
URLs with Hashtags - Does Google Index Them?
Hi there, I have a potential issue with a site whereby all pages are dynamically populated using Javascript. Thus, an example of an URL on their site would be www.example.com/#!/category/product. I have read lots of conflicting information on the web - some says Google will ignore everything after the hashtag; other people say that Google will now index everything after the hashtag. Does anybody have any conclusive information about this? Any links to Google or Matt Cutts as confirmation would be brilliant. P.S. I am aware about the potential issue of duplicate content, but I can assure you that has been dealt with. I am only concerned about whether Google will index full URLs that contain hashtags. Thanks all! Mark
Web Design | | markadoi840