Removing index.php
-
I have question for the community and whether or not this is a good or bad idea.
I currently have a Joomla site that displays www.domain.com/index.php in all the URLs with the exception of the home page. I have read that it's better to not have index.php showing in the URL at all. Does it really matter if I have index.php in my URL? I've read that it is a bad practice.
I am thinking about installing the sh404SEF component on my site and removing the index.php. However, I rank pretty high for the keywords I want in Google, Bing and Yahoo. All of the URLs that show up in the searches have index.php as part of the URL.
Has anyone ever used sh404SEF to remove the index.php and how did you overcome not loosing your search engine links? I don't want an existing search showing www.domain.com/index.php/sales and it not linking to the correct page which would now be www.domain.com/sales. I guess I could insert the proper redirects in the htaccess file. But I was hoping to avoid having every page of my site in the htaccess file for redirecting.
Any help or advice appreciated.
-
Add this to your htaccess file (remove the .txt extension from the file in order to use it)
Remove index.php or index.htm/html from URL requests
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(([^/]+/)*)index.(php|html?)\ HTTP/
RewriteCond %{REQUEST_URI} !^/administrator
RewriteRule ^([^/]+/)*index.(html?|php)$ http://your_site_URL/$1 [R=301,L]Obviously change the your_site_url to the your domain in http://your_site_URL/$1
Also remove the # before RewriteEngine On to make these changes work.
-
Devanur/Jane,
Thank you for the info.
Dan
-
As Devanur says, this will achieve your goal. It's worth reiterating that there is nothing inherently wrong with /index.php URLs as long as you cannot access the same content without /index.php. For instance, if www.site.com/page1/index.php exists as well as www.site.com/page1/, then this is duplicate content and should be fixed. I imagine this is your current situation because this is most common when /index.php is being added to URLs.
However, if only one version of every page loads and that version has the /index.php extension, this is not automatically bad. It's preferable for the extension not to be there for the sake of URL tidiness and because this does move the content one folder-level away from the root (not a huge issue, but probably best avoided) however.
If you go through 301 redirects to shift the old URLs to the new ones without /index.php, your rankings should not suffer. There might be a little bit of ranking fluctuation as Google indexes the new URLs and acknowledges the redirects, but nothing permanent. It's worth noting that this is not an absolute rule, however, and that there is always a risk of lowered rankings or rankings not returning to what they were before after a 301 redirect though.
Cheers,
Jane
-
Hi, any plugin like sh404SEF will work and accomplish your goal without hurting your rankings as long as it redirects, the index.php URLs to their corresponding without index.php URLs via 301. By the way, you don't need to list all your URLs in .htaccess file to implement this. You can go with pattern match redirection.
Here you go for more:
http://www.askapache.com/htaccess/301-redirect-with-mod_rewrite-or-redirectmatch.html
and
http://www.searchenginepeople.com/blog/htaccess-redirect-rewrite-rules.html
By the way, having index.php in URLs does not affect your SEO efforts directly but by stripping index.php from all the URLs will make them look pretty, clean and a bit user friendly.
Hope it helps. Good Luck to you.
Best regards,
Devanur Rafi
<colgroup><col width="182"></colgroup>
| |
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
-
Weird indexing problem - Can it be solved?
Hi Been building and optimising sites for 15 years and this is one of the hardest problems I ever came across. So any help would be very much appreciated. Here we go: For some mysterious reason this URL http://weekend.visitsweden.com/no/ has been indexed as http://weekend.visitsweden.com even if we tried all we can to correct it. The problem is that since the latter points to the first URL with a 301 it refuses to get any page rank. Also it does not get visible in Google at all. Just a recap of what we have tried so far: Add site to webmaster tools Add proper sitemap.xml Add 301 redirect to the correct URL An easy way to locate the problem is to search for the main content of the site. As you can see it returns the wrong URL and the correct URL does not even get listed. Again, any help is very much appreciated. Kind regards Fredrik
Intermediate & Advanced SEO | | Resultify0 -
HTTPS pages - To meta no-index or not to meta no-index?
I am working on a client's site at the moment and I noticed that both HTTP and HTTPS versions of certain pages are indexed by Google and both show in the SERPS when you search for the content of these pages. I just wanted to get various opinions on whether HTTPS pages should have a meta no-index tag through an htaccess rule or whether they should be left as is.
Intermediate & Advanced SEO | | Jamie.Stevens0 -
Advice on Link Removal Services
Hello everyone, Due to the Penguin update my site unfortunately took a bit of a hit. A little while ago I submitted all of our questionable/bad links to the disavow tool, however I still wante to go back and delete any and all problematic links that are still out there. Ive looked into many services, however I haven't been too impressed. Removeem - The email addresses they provided weren't always valid, and their email tool didn't always deploy correctly - a lot of cross referencing and was not saving me any time. Link Detox - Free trial was a bust. They show you 10 links on the free trial, however for me, 9 of the 10 were all the same. Couldn't get a good feel of their system. Rmoov - Their tool is one where you upload your own links, and they help manage everything, however they DONT allow you to email through their system, so Im not sure how this helps my process if I have to do everthing manaully anyway. A lot of sites I see are also a full service approach that charge you based on how many links they remove, and this can get quite costly. I have also contacted:
Intermediate & Advanced SEO | | Lukin
Link Delete - No reponse from multiple email requests
Linkquidator - No response
Infatex - No response My questions to all of you are: Is there any company out there that you recommend that provide a self service tool [online or desktop driven]? Is this even an avenue I should explore, or should I compile my own list [as 3rd party algorithms are not always accurate] and reach out to sites manually? Is disavowing good enough and Im just spinning my wheeles trying to now get them all removed? Thanks!0 -
"No Index" Extensions
Hi there, We run an e-commerce website and we are aware of our duplicate page content/title problems. We know about the "rel canonical" tag and the "no index" tag but I am more interested in the latter. We use a CMS called Magento. Now, Magento has an extension that allows you to use the "no follow" and "no index" tag on products. Google has indexed many of our pages and I wanted to know if applying the "no index" tag on duplicate pages will instruct Google to remove the duplicate url's it has already indexed. I know the tag will tell Google not to index a page but what if I apply it to a product already indexed?
Intermediate & Advanced SEO | | iBags0 -
Limit on Google Removal Tool?
I'm dealing with thousands of duplicate URL's caused by the CMS... So I am using some automation to get through them - What is the daily limit? weekly? monthly? Any ideas?? thanks, Ben
Intermediate & Advanced SEO | | bjs20100 -
Sitemaps / Google Indexing / Submitted
We just submitted a new sitemap to google for our new rails app - http://www.thesquarefoot.com/sitemap.xml Which has over 1,400 pages, however Google is only seeing 114. About 1,200 are in the listings folder / 250 blog posts / and 15 landing pages. Any help would be appreciated! Aron sitemap.png
Intermediate & Advanced SEO | | TheSquareFoot0 -
Removing a Page From Google index
We accidentally generated some pages on our site that ended up getting indexed by google. We have corrected the issue on the site and we 404 all of those pages. Should we manually delete the extra pages from Google's index or should we just let Google figure out that they are 404'd? What the best practice here?
Intermediate & Advanced SEO | | dbuckles0 -
Best practice for removing pages
I've got some crappy pages that I want to delete from a site. I've removed all the internal links to those pages and resubmitted new site maps that don't show the pages anymore, however the pages still index in search (as you would expect). My question is, what's the best practice for removing these pages? Should I just delete them and be done with it or make them 301 re-direct to a nicer generic page until they are removed from the search results?
Intermediate & Advanced SEO | | PeterAlexLeigh0