The Joomla! Forum ™



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.



Post new topic Reply to topic  [ 89 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Wed Apr 20, 2011 12:44 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Apr 20, 2011 11:29 am
Posts: 14
Hello friends

I am using Joomla 1.6(JA Methys 1.6 from joomlart)

Problem is every link has index.php like http://www.mysite.com/index.php/contact

http://www.mysite.com/index.php/about-us

how do i remove these .../index.php/.... from my urls



My SEO setting under Golbal Configuration are

==================================
Search Engine Friendly URLs Yes

Use Apache mod_rewrite Yes

Adds Suffix to URL No

Unicode Aliases No

Include Site Name in Page Titles No
==================================

I have changed htaccess.txt to .htaccess

I have tried every thing but unable to remove index.php in urls

Please help me

My apologies if this exists eslewhere

Thanks in advance


Top
 Profile  
 
PostPosted: Fri Apr 29, 2011 4:54 am 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Sat May 31, 2008 12:15 am
Posts: 209
Location: Yokohama, Japan
Hi. there!

Go to global configuration page.
Set Yes to URL rewriting.

That will remove index.php.

But, you have done this already. Its problem may be in .htaccess
or your server set-up.

Have you checked Joomla 1.6 required server environments?

PHP 5.2+
MySQL 5.0.4+
Apache 2.x+

_________________
Norito H.Yoshida, Yokohama, Japan
norito@gmail.com
http://kaigai.goyat.info/
goyat.jp


Top
 Profile  
 
PostPosted: Fri Apr 29, 2011 8:17 am 
Joomla! Guru
Joomla! Guru

Joined: Mon Feb 21, 2011 4:02 pm
Posts: 951
Location: UK
Once you have it working, you will need to add a redirect to your .htaccess file such that if URLs with index.php continue to be requested by users following old links in SERPs and in bookmarks they are redirected to the new URL without it.

Code:
RewriteCond %{THE_REQUEST} !^POST
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php/([^\ ]*)\ HTTP/
RewriteCond %{SERVER_PORT}>s ^(443>(s)|[0-9]+>s)$
RewriteRule ^(([^/]+/)*)index\.php/(.*)$ http%2://www.example.com/$1$2 [R=301,L]

I urge you to use the new .htaccess file that comes with Joomla 1.5.23 onwards and Joomla 1.6.2 onwards. Look for the file called htaccess.txt in the installer package. It contains a note showing exactly where the redirects should go (in addition to a number of other changes). Add your new redirect code in the file at the point it says "redirects go here", or similar.

You might also want to add this code too:
Code:
########## Begin - 301 Redirect
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*(index|home)\.html?\ HTTP/
RewriteRule ^(([^/]+/)*)(index|home)\.html?$ http://www.example.com/$1 [R=301,L]
#
RewriteCond %{THE_REQUEST} !^POST
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/
RewriteCond %{SERVER_PORT}>s ^(443>(s)|[0-9]+>s)$
RewriteRule ^(([^/]+/)*)index\.php$ http%2://www.example.com/$1 [R=301,L]
#
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
#
########## End - 301 Redirect

_________________
Online since 1995.


Top
 Profile  
 
PostPosted: Tue May 31, 2011 7:03 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun Feb 24, 2008 5:22 am
Posts: 33
Are you using a Windows server?? if so you must have Mod rewrite.. but the server wont control what joomla renders...

Make sure your web.config.txt is renamed to web.config if your on a IIS server or that your htaccess.txt is .htaccess

And then Change your configuration settings to normal and then save, and retry your SEO Settings

Search Engine Friendly URLs are ON
Use URL rewriting is ON


let me know when you get it working.. if its doesnt let me know and ill take a look.

Bret


Top
 Profile  
 
PostPosted: Tue May 31, 2011 7:49 am 
Joomla! Guru
Joomla! Guru

Joined: Mon Feb 21, 2011 4:02 pm
Posts: 951
Location: UK
To clear up the confusing post above.

Use .htaccess if your server uses Apache.

Use web.config if your server uses IIS.

_________________
Online since 1995.


Top
 Profile  
 
PostPosted: Fri Jun 03, 2011 11:27 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Fri Jun 03, 2011 11:03 am
Posts: 14
Location: 神戸 三宮
I realize this is late, but for anyone finding this thread in google, like I just did, I found a real simple way to solve the OP's problem!

put this in your .htaccess file
Code:
RedirectMatch 301 ^/index.php/(.*)$ http://www.domain.com/$1


don't forget to change www.domain.com to your own domain!

_________________
www.realizeenglish.com - The Joomla site I manage :)


Top
 Profile  
 
PostPosted: Fri Jun 03, 2011 9:17 pm 
Joomla! Guru
Joomla! Guru

Joined: Mon Feb 21, 2011 4:02 pm
Posts: 951
Location: UK
RealJames wrote:
Put this in your .htaccess file
Code:
RedirectMatch 301 ^/index.php/(.*)$ http://www.domain.com/$1

don't forget to change http://www.domain.com to your own domain!

For many reasons you should not use RedirectMatch in the same .htaccess file as any RewriteRule directives. This code should be used:
Code:
RewriteCond %{THE_REQUEST} !^POST
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php/([^\ ]*)\ HTTP/
RewriteCond %{SERVER_PORT}>s ^(443>(s)|[0-9]+>s)$
RewriteRule ^(([^/]+/)*)index\.php/(.*)$ http%2://www.example.com/$1$2 [R=301,L]

_________________
Online since 1995.


Top
 Profile  
 
PostPosted: Mon Jun 13, 2011 7:27 pm 
Joomla! Guru
Joomla! Guru

Joined: Mon Feb 21, 2011 4:02 pm
Posts: 951
Location: UK
The canonical URL for the site root is http://www.example.com/ with a trailing slash and without index filename.

_________________
Online since 1995.


Top
 Profile  
 
PostPosted: Sun Jun 19, 2011 4:04 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon May 30, 2011 7:23 pm
Posts: 19
Hi

I also have the same problem removing the index.php from URLs. The use SEO-friendly URL and URL re-write options are enabled on joomla global configuration.

Apache version 2.2.16
PHP version 5.2.14
MySQL version 5.0.91-community
Joomla 1.6.3 mod_rewrite enabled by hosting company so we can access our own .htaccess files.

.htaccess file is ammended with the base URL
RewriteBase /~username/subdirectory

I have done this because the joomla installation is in a subdirectory. When I click a link to load a page the URL is re-written without the index.php/ but the page is not loaded and an error message informing of website maintenance appears instead. If I change the subdirectory path in .htaccess to anything else I get internal server error500 if I try to access any page.

Please help!


Top
 Profile  
 
PostPosted: Sun Jun 19, 2011 11:59 pm 
Joomla! Guru
Joomla! Guru

Joined: Mon Feb 21, 2011 4:02 pm
Posts: 951
Location: UK
Quote:
When I click a link to load a page the URL is re-written without the index.php/

To be absolutely clear, do you see URLs without index.php in the browser status bar when you mouseover the on-page link without clicking it?

URL rewriting starts by publishing the right URL in the link on the page. It is too late to change the URL after the link is clicked.

Is the .htaccess file located at example.com/.htaccess or at example.com/folder/.htaccess here?

_________________
Online since 1995.


Top
 Profile  
 
PostPosted: Mon Jun 20, 2011 12:57 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon May 30, 2011 7:23 pm
Posts: 19
Hi, great to get your reply

URL

From the homepage when I click on a menu link to a sublevel page the re-written URL is shown correctly in the status bar of the browser e.g.

mysite.com/contact

However the page is not loaded, unless I go in and alter the URL to include /index.php/ when it works just fine.

.HTACCESS

.htaccess file I am ammending is located in the subfolder of the joomla installation - i.e. in

subfolder.myhostingdomain.com

where mysite.com is my domain name that maps to the subfolder above.

Hope that's a bit clearer!


Top
 Profile  
 
PostPosted: Mon Jun 20, 2011 1:26 pm 
Joomla! Guru
Joomla! Guru

Joined: Mon Feb 21, 2011 4:02 pm
Posts: 951
Location: UK
Quote:
From the homepage when I click on a menu link to a sub-level page the re-written URL is shown correctly in the status bar of the browser.

That wasn't the question. The question is:
Quote:
To be absolutely clear, do you see URLs without index.php in the browser status bar (that's the one at the bottom of the window) when you mouseover the on-page link without clicking it?

_________________
Online since 1995.


Top
 Profile  
 
PostPosted: Tue Jun 21, 2011 5:43 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon May 30, 2011 7:23 pm
Posts: 19
g1smd wrote:
Quote:
From the homepage when I click on a menu link to a sub-level page the re-written URL is shown correctly in the status bar of the browser.

That wasn't the question. The question is:
Quote:
To be absolutely clear, do you see URLs without index.php in the browser status bar (that's the one at the bottom of the window) when you mouseover the on-page link without clicking it?


Yes it shows correctly if you mouse over or click. But the page does not load.


Top
 Profile  
 
PostPosted: Wed Jun 22, 2011 6:15 am 
Joomla! Guru
Joomla! Guru

Joined: Mon Feb 21, 2011 4:02 pm
Posts: 951
Location: UK
The .htaccess file is not being read because it is in the wrong folder, or the RewriteBase value in the .htaccess file is incorrect.

Alternatively, the $livesite variable (in configuration.php) has the wrong value. It may even be a combination of those things.

_________________
Online since 1995.


Top
 Profile  
 
PostPosted: Wed Jun 22, 2011 1:24 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon Jun 20, 2011 2:23 pm
Posts: 35
Location: Ukraine, Lviv
just need to activate mod_rewrite in .htaccess file

_________________
http://brodiahy.org.ua/


Top
 Profile  
 
PostPosted: Fri Jun 24, 2011 10:17 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon May 30, 2011 7:23 pm
Posts: 19
Thanks for your replies.

What should the 'livesite' variable be? The domain name people use to access the site or the physical location?

With the .htaccess file Base rewrite, if I change the path to anything other than the physical location the error is 'Internal Server Error' rather than the better error message I wrote for when a page can not be loaded. So I think it is the correct path? The URL is re-written but the page can not be loaded (apart from the homepage of course).


Top
 Profile  
 
PostPosted: Fri Jun 24, 2011 10:53 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Mon May 30, 2011 7:23 pm
Posts: 19
Update: well I've managed to find a solution - I basically just commented out the base rewrite rule and tried it with the .htaccess and it worked! Didn't need base rewrite or livesite after all.

Thanks everyone :-)


Top
 Profile  
 
PostPosted: Wed Jun 29, 2011 11:21 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Jun 18, 2011 11:00 am
Posts: 24
Guys I am a little confused about renaming the htaccess.txt file. All files have extentions. Am I going to be renaming it to .htaccess without the .txt extension or is it going to be .htaccess.txt. I already tried chanting it to .htaccess without the .txt extension then changing my mod rewrite from no to yes and it didn't work. I experienced the same problem as the guy above. my home page would show but my other pages wouldn't. So is it supposed to be .htaccess.txt or just .htaccess? Because if it's just .htaccess without any extension, that sounds a little wierd to me.


Top
 Profile  
 
PostPosted: Thu Jun 30, 2011 7:18 pm 
Joomla! Guru
Joomla! Guru

Joined: Mon Feb 21, 2011 4:02 pm
Posts: 951
Location: UK
Filenames beginning with a period are system files. The name you need is exactly ".htaccess".

The file is distributed as "htaccess.txt" to make it easier to open in a standard text editor.

_________________
Online since 1995.


Top
 Profile  
 
PostPosted: Sat Jul 23, 2011 6:58 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Apr 20, 2011 11:29 am
Posts: 14
thnx to every one my problem got fixed

i enabled rewrite_module in apache modules

edited the code in .htaccess

thk u very much


Top
 Profile  
 
PostPosted: Mon Jul 25, 2011 9:11 pm 
Joomla! Guru
Joomla! Guru

Joined: Mon Feb 21, 2011 4:02 pm
Posts: 951
Location: UK
If Google has already indexed URLs with /index.php/ in them, you need a redirect to tell them that they need to de-index those URLs and index the new ones.

However, never mix RedirectMatch and RewriteRule directives in the same site. Use RewriteRule for all of your rules.
Code:
RewriteRule ^index\.php/(.+)$ http://www.example.com/$1 [R=301,L]

Placement of this rule with respect to other rules (i.e. rule ordring) is very important.

_________________
Online since 1995.


Top
 Profile  
 
PostPosted: Fri Oct 21, 2011 8:46 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Feb 17, 2010 8:48 am
Posts: 14
Hi guys,

I really hate this /index.php/

I set:
Search Engine Friendly URLs ON
Use URL rewriting ON

I changed htaccess.txt to .htaccess and I get correct url in browsers but also 404 page.

Please help :(


Top
 Profile  
 
PostPosted: Sun Oct 30, 2011 11:53 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sun May 23, 2010 11:25 pm
Posts: 34
Simple solution is add this to the .htaccess file

RewriteBase /.

Don't forget the . after the /
worked for me on Rackspace cloud


Top
 Profile  
 
PostPosted: Wed Nov 02, 2011 9:49 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Wed Feb 17, 2010 8:48 am
Posts: 14
Sorry guys, I made a mistake. ;)

It works great, with this to steps:

1) edit htaccess.txt to .htaccess
2) turn on seo in Joomla backend

thanks!


Top
 Profile  
 
PostPosted: Sat Nov 12, 2011 1:26 am 
Joomla! Guru
Joomla! Guru

Joined: Mon Feb 21, 2011 4:02 pm
Posts: 951
Location: UK
3) Set up a redirect so that requests for the old URL are redirected to the new URL. This forces searchengines to update the listings for your site, and retains the traffic to your site while the old URLs are still indexed and ranking.

_________________
Online since 1995.


Top
 Profile  
 
PostPosted: Mon Jan 16, 2012 2:51 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Mon Jan 16, 2012 2:48 pm
Posts: 1
Hi everyone,

I'm still stumped by this and cannot remove it from our site, I've tried enabling SEO and apache rewrite,. I've even renamed the htaccess file and still no joy.

I've tried to redirect as well and still no joy, it keeps coming up with a 404 error.

Does anyone have any idea at all what it could be?

Thanks


Top
 Profile  
 
PostPosted: Tue Jan 17, 2012 6:31 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Tue Jan 17, 2012 6:21 am
Posts: 1
g1smd wrote:
Once you have it working, you will need to add a redirect to your .htaccess file such that if URLs with index.php continue to be requested by users following old links in SERPs and in bookmarks they are redirected to the new URL without it.

Code:
RewriteCond %{THE_REQUEST} !^POST
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php/([^\ ]*)\ HTTP/
RewriteCond %{SERVER_PORT}>s ^(443>(s)|[0-9]+>s)$
RewriteRule ^(([^/]+/)*)index\.php/(.*)$ http%2://www.example.com/$1$2 [R=301,L]

I urge you to use the new .htaccess file that comes with Joomla 1.5.23 onwards and Joomla 1.6.2 onwards. Look for the file called htaccess.txt in the installer package. It contains a note showing exactly where the redirects should go (in addition to a number of other changes). Add your new redirect code in the file at the point it says "redirects go here", or similar.

You might also want to add this code too:
Code:
########## Begin - 301 Redirect
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*(index|home)\.html?\ HTTP/
RewriteRule ^(([^/]+/)*)(index|home)\.html?$ http://www.example.com/$1 [R=301,L]
#
RewriteCond %{THE_REQUEST} !^POST
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/
RewriteCond %{SERVER_PORT}>s ^(443>(s)|[0-9]+>s)$
RewriteRule ^(([^/]+/)*)index\.php$ http%2://www.example.com/$1 [R=301,L]
#
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
#
########## End - 301 Redirect


thanks. it work


Top
 Profile  
 
PostPosted: Mon Jan 23, 2012 1:05 pm 
Joomla! Fledgling
Joomla! Fledgling

Joined: Mon Jan 23, 2012 12:58 pm
Posts: 3
Took me out happy to read this comment. You are really blow job, things are happen in the world elegant nice post. Thanks for sharing the knowledge.


Top
 Profile  
 
PostPosted: Wed Jan 25, 2012 7:45 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Sat Feb 24, 2007 11:27 pm
Posts: 42
so in my case....

in my .htaccess file i have 1000+ rewriteRules for SEO/SERP because a site has been redesigned and moved to new server...

well... now here's what's happening.

{{Joomla 1.7 site}}

with URL Rewriting on - the site does not work. None of the navigation main menu links work.

with URL Rewriting OFF - site works great but has ugly index.php in all URLs

this is an example of the 1000+ rewrite rules I have in my .htaccess

RewriteCond %{QUERY_STRING} ^option=com_content&view=article&id=107&Itemid=193
RewriteRule ^index\.php$ http://www.thesitenamehere.org? [R=301,L]

with URL Rewriting on - mousing over link shows the correct URL structure - like http://www.thesitenamehere.org/news-events

but clicking on the nav menu link does nothing

config file shows live_site at http://www.thesitenamehere.org

mod_rewrite is on and enabled because it was all working beautifully before I did the 1000+ rewrites.

I think my error is in my rewrites / .htaccess file some how.

adding these bits to .htaccess made NO urls work - whether or not URL Rewriting was on or off - nothing worked

########## Begin - 301 Redirect
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*(index|home)\.html?\ HTTP/
RewriteRule ^(([^/]+/)*)(index|home)\.html?$ http://www.sitenamehere.org/$1 [R=301,L]
#
RewriteCond %{THE_REQUEST} !^POST
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/
RewriteCond %{SERVER_PORT}>s ^(443>(s)|[0-9]+>s)$
RewriteRule ^(([^/]+/)*)index\.php$ http%2://www.sitenamehere.org/$1 [R=301,L]
#
RewriteCond %{HTTP_HOST} !^(www\.sitenamehere\.org)?$
RewriteRule (.*) http://www.sitenamehere.org/$1 [R=301,L]
#
########## End - 301 Redirect

what kind of Redirect/Rewrite .htaccess monster have I created here??!?!

thanks


************ UPDATE

I cleared my browser's cache and everything is now working correctly. With URL Rewriting on, redirects are working. SEF are good.

working fine in FF8 and IE8


Top
 Profile  
 
PostPosted: Sat Feb 18, 2012 6:22 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Sat Feb 18, 2012 6:14 am
Posts: 2
I have successfully removed the index.php from my URLs (I think) but I am having trouble with the re-directs I think - here is what happens:

When I insert the following suggested code in the designated area on the .htaccess file whenever I go to an old link it simply takes me to the homepage rather than to the "new" non-index.php version of the page:

Code:
RewriteCond %{THE_REQUEST} !^POST
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php/([^\ ]*)\ HTTP/
RewriteCond %{SERVER_PORT}>s ^(443>(s)|[0-9]+>s)$
RewriteRule ^(([^/]+/)*)index\.php/(.*)$ http%2://www.example.com/$1$2 [R=301,L]

If I instead enter the following code - it no longer takes me to the homepage but seems to not be doing a redirect as index.php remains in the URL. Also both the index.php and "new" non-index.php pages get picked up in a sitemap search when using the following code:

Code:
########## Begin - 301 Redirect
#
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*(index|home)\.html?\ HTTP/
RewriteRule ^(([^/]+/)*)(index|home)\.html?$ http://www.example.com/$1 [R=301,L]
#
RewriteCond %{THE_REQUEST} !^POST
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.php\ HTTP/
RewriteCond %{SERVER_PORT}>s ^(443>(s)|[0-9]+>s)$
RewriteRule ^(([^/]+/)*)index\.php$ http%2://www.example.com/$1 [R=301,L]
#
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
#
########## End - 301 Redirect

Can someone point to what is wrong here and which code is preferred and why I might be getting these anomalies with each? I don't want to send Google on a wild goose chase - SEO is very important. Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 89 posts ]  Go to page 1, 2, 3  Next



Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group