.htaccess index.php

Discuss Search Engine Optimization in relation to Joomla! 3.x. This forum will also have discussions on SEF/SEO Joomla! 3.x extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
Filipsa
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 110
Joined: Tue Sep 22, 2009 12:14 pm

.htaccess index.php

Post by Filipsa » Fri Mar 09, 2018 11:07 pm

Hi
I already have some important links to my english side of website
mysite.com/index.php/en

after renaming htaccess.txt to .htaccess now I have both
mysite.com/index.php/en and
mysite.com/en
what is of course a duplicate content

mybe its best to 301 redirect mysite.com/en to mysite.com/index.php/en

mysite.com/en will be counted as new page

I know mysite.com/en will get link equity from mysite.com/index.php/en but it will take some time for search engines credit mysite.com/en with the rankings and trust of mysite.com/index.php/en

As I can not afford this I would just like to have same url structure as before renaming htaccess.txt to .htaccess

Can someone help me code for .htaccess please?

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30915
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: .htaccess index.php

Post by Per Yngve Berg » Sat Mar 10, 2018 8:42 am

Have you submitted a site map to Google?

Set the URL without the index.php as canonical.

Filipsa
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 110
Joined: Tue Sep 22, 2009 12:14 pm

Re: .htaccess index.php

Post by Filipsa » Mon Mar 12, 2018 8:12 am

I don't want to make a canonical page but I tried this

Code: Select all

# Use PHP70CGI as default
AddHandler fcgid70-script .php
AddHandler application/x-httpd-php70 .php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>


Redirect 301 /mysite.com/en http://www.mysite.com/index.php/en
Redirect 301 /mysite.com/fr http://www.mysite.com/index.php/fr
What do You think?
Is this right way to do it?
Im worried not to messup my rankings...

Filipsa
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 110
Joined: Tue Sep 22, 2009 12:14 pm

Re: .htaccess index.php

Post by Filipsa » Wed Mar 21, 2018 10:53 pm

Any suggestions, please?

AcerPK
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Mon Mar 26, 2018 12:06 pm

Re: .htaccess index.php

Post by AcerPK » Mon Mar 26, 2018 6:17 pm

# Redirect html pages to the root domain
RewriteRule ^index\.php$ / [R=301,L]
RewriteRule ^(.*)/index\.php$ /$1/ [R=301,L]

Simon_J
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed Mar 28, 2018 2:50 pm

Re: .htaccess index.php

Post by Simon_J » Wed Mar 28, 2018 3:04 pm

I would recommend to drop the index.php in the URL, as it will only make it longer. So go for the mysite.com/en if you ask me.


Locked

Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 3.x”