How do I get http://mysite.com/ indexed in a search engine, not http://mysite.com/index.php, and nothing more?

by june.crooks , in category: SEO , a year ago

How do I get http://mysite.com/ indexed in a search engine, not http://mysite.com/index.php, and nothing more?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

3 answers

Member

by dudley , a year ago

@june.crooks 

To get the desired URL indexed by search engines, you can do the following:

  1. Use a permanent (301) redirect from the index.php URL to the desired URL
  2. Update any internal links to the desired URL
  3. Add the desired URL to your sitemap and submit it to search engines
  4. Use the "rel=canonical" tag on the index.php URL to indicate the preferred URL
  5. Add the desired URL to Google Search Console and monitor it for crawl errors or indexing issues.


It's important to note that search engines may still index both URLs, but the one with the highest authority (most links pointing to it, etc.) is likely to rank higher in search results.

Member

by julio , 4 months ago

@june.crooks 

To ensure that only the desired URL (http://mysite.com/) is indexed by search engines, you can follow these steps:

  1. Set up a 301 redirect: Configure your web server to redirect the index.php URL to the desired URL using a permanent redirect (HTTP 301 status code). This will inform search engines that the desired URL is the preferred one.
  2. Update internal links: Make sure that all internal links on your website point directly to the desired URL. This includes any links within your navigation menus, footer, sidebar, and within your website's content.
  3. XML sitemap: Create an XML sitemap that includes only the desired URL and submit it to search engines. This will help search engines discover the desired URL and prioritize it for indexing.
  4. Rel=canonical tag: Add a rel=canonical tag to the index.php URL, specifying the desired URL as the preferred version. This will signal search engines that the desired URL should be indexed and displayed in search results.
  5. Google Search Console: Add both the index.php URL and the desired URL to Google Search Console (formerly known as Google Webmaster Tools). Monitor the indexing status and resolve any crawl or indexing errors that may arise.


By implementing these steps, you are providing clear signals to search engines about your preferred URL, increasing the chance of successful indexing and display of the desired URL in search results.

by harrison.goodwin , 4 months ago

@june.crooks 

To ensure that only the desired URL (http://mysite.com/) is indexed by search engines and not the index.php version, you can follow these steps:

  1. Use a 301 redirect: Set up a permanent redirect from the index.php version to the desired URL. This can be done in your website's .htaccess file or through server configuration. For example, in Apache, you can use the following code:
1
2
3
RewriteEngine On
RewriteCond %{HTTP_HOST} ^mysite.com [NC]
RewriteRule ^index.php$ http://mysite.com/ [L,R=301]


  1. Update internal links: Go through your website and ensure that all internal links point directly to the desired URL (http://mysite.com/). This includes links in navigation menus, footer, sidebar, and within the website's content.
  2. XML sitemap: Create an XML sitemap that includes only the desired URL (http://mysite.com/). Submit this sitemap to search engines, such as Google Search Console and Bing Webmaster Tools. This will help search engines discover and prioritize the desired URL for indexing.
  3. rel=canonical tag: Add a rel=canonical tag to the index.php version of your URLs to indicate the preferred URL. In the section of your HTML file, add the following code:
1
<link rel="canonical" href="http://mysite.com/" />


This tag tells search engines that the desired URL is the preferred version.

  1. Fetch and render: Use the Fetch as Google tool in Google Search Console to ensure that the desired URL is being fetched and rendered correctly by Google. This can help identify any issues that may prevent indexing.


By following these steps, you are providing clear signals to search engines that the desired URL should be indexed and displayed in search results, while discouraging indexing of the index.php version.