Can I remove index.php from seo links?

Discuss Search Engine Optimization in relation to Joomla! 2.5. This forum will also have discussions on SEF/SEO Joomla! 2.5 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.
Locked
David Henry
Joomla! Intern
Joomla! Intern
Posts: 70
Joined: Wed Feb 05, 2014 12:05 pm

Can I remove index.php from seo links?

Post by David Henry » Fri Jul 18, 2014 4:36 pm

Hi Guys,

No matter what xml site map builder I use (xmap, JSitemap etc.) the output includes index.php in each link, how do I get this out?

for example:
Code:
http://www.example.ie/index.php/About-U ... ekers.html

should be...
Code:
http://www.example.ie/About-Us/job-seekers.html

I've noticed that we have...

Code: Select all

RewriteCond %{THE_REQUEST} ^[A-Z]+\ /index\.php(/[^\ ]*)?\ HTTP/
RewriteRule ^index\.php(/(.*))?$ /$2 [R=301,L]

in the .htaccess already, I'm not sure why as we already have...

SEO Settings

Search Engine Friendly URLs = Yes
Use URL rewriting = Yes
Adds Suffix to URL = Yes
Unicode Aliases = Yes

If I remove the additional htaccess code all links change to:
Code:
http://www.example.ie/index.php/About-Us/whatever.html

Really stuck on this and the client is getting anxious.

Anyone any clue?

itoctopus
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4025
Joined: Mon Nov 25, 2013 4:35 pm
Location: Montreal, Canada
Contact:

Re: Can I remove index.php from seo links?

Post by itoctopus » Fri Jul 18, 2014 7:43 pm

I don't know why you have these lines:

Code: Select all

RewriteCond %{THE_REQUEST} ^[A-Z]+\ /index\.php(/[^\ ]*)?\ HTTP/
RewriteRule ^index\.php(/(.*))?$ /$2 [R=301,L]
In your .htaccess file. I don't think they should be there at all.

You should download a fresh copy of Joomla and replace your current .htaccess file with the .htaccess file in that copy (rename it from htaccess.txt).
http://www.itoctopus.com - Joomla consulting at its finest
https://twitter.com/itoctopus - Follow us on Twitter

David Henry
Joomla! Intern
Joomla! Intern
Posts: 70
Joined: Wed Feb 05, 2014 12:05 pm

Re: Can I remove index.php from seo links?

Post by David Henry » Mon Jul 21, 2014 11:49 am

thanks itoctopus,

that's the first thing i did but then I ended up with all urls including the index.php in the seo friendly url. Like this...

http://www.example.ie/idex.php/About-Us/any-page.html

I think that is the root of the issue but how do I fix it so that it's not in either the SEO links or the sitemaps?

D

itoctopus
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4025
Joined: Mon Nov 25, 2013 4:35 pm
Location: Montreal, Canada
Contact:

Re: Can I remove index.php from seo links?

Post by itoctopus » Mon Jul 21, 2014 4:33 pm

Hi David,

That shouldn't be the case. Are you sure you're not using another 3rd party extension for URL rewriting? Maybe it's overwriting Joomla's own SEF tool. Are you sure you're not using sh404SEF, for example?
http://www.itoctopus.com - Joomla consulting at its finest
https://twitter.com/itoctopus - Follow us on Twitter

David Henry
Joomla! Intern
Joomla! Intern
Posts: 70
Joined: Wed Feb 05, 2014 12:05 pm

Re: Can I remove index.php from seo links?

Post by David Henry » Tue Jul 22, 2014 10:34 am

you hit it on the nail!!!

sh404SEF has a setting to use htaccess or index.php, the later will cause this issue every time.

Problem solved!

David


Locked

Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 2.5”