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
-
Website Redesign & Ensuring Minimal Traffic/Rankings Lost
Hi there, We have undergone a website redesign (mycompany.com) and our site is ready to go live however the new website is built on a different platform so all of our blog pages will not be copied over - to avoid a large web developer expense. So our intention is to then leave all the blog pages as (on the old web design) but move it to the domain blog.mycompany.com with 301 redirects inserted on mycompany.com for each blog post pointing to the corresponding blog.mycompany.com. Is there anything else we should do to ensure minimal traffic/rankings are lost? Thank you so much for your help.
Web Design | | amitbroide0 -
Have Your Thoughts Changed Regarding Canonical Tag Best Practice for Pagination? - Google Ignoring rel= Next/Prev Tagging
Hi there, We have a good-sized eCommerce client that is gearing up for a relaunch. At this point, the staging site follows the previous best practice for pagination (self-referencing canonical tags on each page; rel=next & prev tags referencing the last and next page within the category). Knowing that Google does not support rel=next/prev tags, does that change your thoughts for how to set up canonical tags within a paginated product category? We have some categories that have 500-600 products so creating and canonicalizing to a 'view all' page is not ideal for us. That leaves us with the following options (feel it is worth noting that we are leaving rel=next / prev tags in place): Leave canonical tags as-is, page 2 of the product category will have a canonical tag referencing ?page=2 URL Reference Page 1 of product category on all pages within the category series, page 2 of product category would have canonical tag referencing page 1 (/category/) - this is admittedly what I am leaning toward. Any and all thoughts are appreciated! If this were in relation to an existing website that is not experiencing indexing issues, I wouldn't worry about these. Given we are launching a new site, now is the time to make such a change. Thank you! Joe
Web Design | | Joe_Stoffel1 -
Magento 2.1 Multi Store / SEO
This is quite technical but I'm hoping a Magento expert can clear this up for me. Currently my company has two websites on separate Opencart platforms. What I'm doing now is building a Magento website and using the multi store function as well as a few modules to combine the two sites, the aim being that the link juice is shared and I can focus my SEO efforts on the one site instead of two, thus reducing my workload while maintaining the benefits. This is the intended layout: www.domain.com www.domain.com/us I have created a sub-folder (not a subdomain) as this seems to be the best way to share link juice between the new, combined sites (as well as 301s from the old, redundant site). At the moment I have created 2 separate websites, stores and store views (see attached) and have configured it according to the Magento guide, so I know that technically this is correct but I need to make sure that I have done it correctly in relation to SEO. Is the sub-folder set up correctly for instance? Currently the only files to populate that sub-folder are a htaccess, error log and index.php (see attached). Also, is there anything I could be missing in relation to SEO within the parameters of what I am trying to achieve? Additionally, only one store view appears in the "change store view" section of the home page. This is causing me to question if I have set it up correctly, because I had assumed both store views would appear even if they were under different websites (attached). OR do I simply use the same website and create two stores and store views? Do I also need to create a separate database for each website/store/store view? I would very much appreciate if someone could help out here. Thank you. In1Gi7t pyfM03y nUQoMz1
Web Design | | moon-boots0 -
Why Is Google Showing My Images Upside Down in the Index?
Hi, My client has PDFs of their catalog on the site which google is indexing. However, it seems that google is taking an image from the catalog and then showing it upside in the index for images/search results. The images are not upside down on the site. Has anyone heard of this happening before or does anyone know a way to fix it? Thanks
Web Design | | AliMac260 -
Needs clarification: How "Disallow: /" works?
Hi all, I need clarification on this. I have noticed we have given "Disallow: /" in one of our sub-directory beside homepage. So, how it going to work now? Will this "Disallow: /" at sub-directory level going to disallow only that directory or entire website? If it is going to work for entire website; we have already given one more Disallow: / at homepage level blocking few folders. How it is going to handle with two Disallow: / commands? Thanks
Web Design | | vtmoz0 -
Is Sitewide Credit Link Good or Bad in 2015?
We are a web design agency thus we get a good number of links (footer) from our client's site. According to Matt Cutt, Google considers all the sitewide links to 1. So is it okay to have those links? Note: Those links are do-follow and most with 2 anchor text. "Web Design" by "Company Name" and "Website Development" by."Company Name". Thanks
Web Design | | Jubaer961 -
Decreasing Page Load Time with Placeholder Images - Good Idea or Bad Idea?
In an effort to decease our page load time, we are looking at making a change so that all product images on any page past page 1 load with a place holder image. When the user clicks to the next page, it then loads all of the images for that page. Right now, all of the product divs are loaded into a Javascript array and loaded in chunks to the page display div. Product-heavy pages significantly increase load time as the browser loads all of the images from the product HTML before the Javascript can rewrite the display div with page-specific product HTML. In order to get around this, we are looking at loading the product HTML with a small placeholder image and then substituting the appropriate product image URLs when each page is output to the display div. From a user experience, this change will be seamless and they won't be able to tell the difference, plus they will benefit from a potentially a short wait on loading the images for the page in question. However, the source of the page will have all of the product images in a given category page all having the same image. How much of a negative impact will this have on SEO?
Web Design | | airnwater0 -
Javascript, PhP and SEO Impact?
What are the Pro's and Con's of using Java Script and PHP in a site when factoring in SEO?
Web Design | | bronxpad0