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
-
Does a similar CMS fabric/theme used by 2 colleagues, cause SEO issues?
Does using the same CMS fabric/theme with substantially different content for each website but the same business address (on google places and the websites) cause SEO issues? For example: 2 colleagues with somewhat similar services located at the same business addresses desire to use the same CMS fabric /theme but will have different content on the sites. Will this hurt their SEO / should they use a different website skin/theme?
Web Design | | toti5880 -
We added hundreds of pages to our website & restructured the layout to include 3 additional locations within the sub-pages, same brand/domain name. How long could Google take to crawl/index the new pages and rank the keywords used within those pages?
We added hundreds of pages to our website & restructured the layout to include 3 additional locations within the sub-pages, same brand/domain name. The 3 locations old domains were redirected to their sites within our main brand domain. How long could Google take to crawl/index the new pages and rank the keywords used within those pages? And possibly increase our domain authority hopefully? We didn't want our brand spread out over multiple websites/domains on the internet. This also allowed for more content to be written on pages, per each of our locations service's, as well.
Web Design | | BurgSimpson0 -
Moving youtube videos between accounts/channels
Hi.
Web Design | | corn2015
If you have a youtube channel that has a lot of videos on it and need to move the videos to another channel, is there an easy method to do this without having to download and re-upload them?0 -
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 -
Why would a developer build all page content in php?
Picked up a new client. Site is built on Wordpress. Previous developer built nearly all page content in their custom theme's PHP files. In other words, the theme's "page.php" file contains virtually all the HTML for each of the site's pages. Each individual page's back-end page editor appears blank, except for some of the page text. No markup, no widgets, no custom fields. And no dedicated, page-specific php files either. Pages are differentiated within page.php using: elseif (is_page("27") Has anyone ever come across this approach before? Why might someone do this?
Web Design | | mphdavidson0 -
Multiple websites for different service areas/business functions?
I'm wondering what the implications are for having multiple domains for different service areas of a company? I realize having multiple domains for one company can be troublesome because of the possibility of duplicate content, keyword cannibalization, and linkbuilding to multiple domains. But when the domains are for very different service offerings/unique business functions that each serve their own purpose (and have different positionings), is there a downside to having more than one domain? Any thoughts would be appreciated!
Web Design | | KevinBloom0 -
Traffic flow going through homepage, /default.aspx, and /index.htm - How do I fix this?
In the Google Analytics visitor flow section, most of my traffic is starting off on the homepage, but a significant portion somehow is being directed to /default.aspx, as well as a minor fraction at /index.htm - see the attached image for what this looks like. My questions are, why is this happening, is it negatively affecting the site, and should I just fix it through a filter in Analytics or consult IT? Navigating to the /default.aspx page in the address bar simply returns a blank screen. Any idea of what's going on here? The logo in the top left corner of the site directs to /index.htm, so I think I have that issue solved, but /default.aspx is definitely stumping me. The server currently runs on Apache, though I don't know if it always did. My standard method of simply Googling the problem didn't give me any definitive answers, so any help would be greatly appreciated. Q12QqpC.jpg
Web Design | | BD690 -
Too many Internal Links: A good thing or bad thing?
According to Moz i have over 500 links on some pages, GWT says about 400 with most (90%) having about 210 links. When I eyeball the site it should have no more than 30 to 40, but my web agency tells me its because the way the CMS works (DotNetNuke) that all pages are linked via the top navigation. Does this mean that my internal linking strategy is flawed before i even start to consider which pages I want to have more links to? Our site www.over50choices.co.uk was rebranded & moved to the new CMS in June 2013. Should i be concerned or is this OK? Ash
Web Design | | AshShep10