Tuesday, May 22nd

Last update05:36:30 AM GMT

Font Size

Screen

Profile

Layout

Menu Style

Cpanel
Welcome, Guest
Username Password: Remember me

Redirects
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Redirects

Redirects 2 years, 2 months ago #2623

  • Laurie
  • OFFLINE
  • Expert Boarder
  • Posts: 130
  • Karma: 3
G'day there.

I'm trying to do redirects to send the non www to www and also index.php to the domain (I think TLD is the term).

The redirects that I'm doing in cPanel are having no effect but they show up in the .htaccess file.

I currently have removed the redirects.

Here is the important part of the .htaccess file:
########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section


Please note that I don't really understand the .htaccess file. I just see a few familiar things like index.php.

There are some notes further up the file about commenting some things in or out. Could that be the problem?

Is there something that my host needs to do?

Have I not done the SEF in Joomla correctly?

Thanks,
Laurie.
On the way to being a basic Joomla user.
www.australianexplorers.com.au/

Re:Redirects 2 years, 2 months ago #2624

  • erimkus
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
  • Karma: 1
I just looked into this myself...I added:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^yoursite.com
RewriteRule (.*) www.yoursite.com/$1 [R=301,L]

These are lines 25, 26, 27 of the default Joomla 1.5.15 htaccess file.

The SEF works with the htaccess file "out of the box" and all SEF switches activated in the Site Configuration under Joomla Admin.
Last Edit: 2 years, 2 months ago by erimkus.

Re:Redirects 2 years, 2 months ago #2625

  • buipy001
  • OFFLINE
  • Administrator
  • Posts: 250
  • Karma: 12
Yep thats right, this was bought up at the JUG Sydney meeting this month too.

www.joomladay.org.au/communityforum/13-m...0-march-meeting#2600
The only limitation is your imagination
www.pbwebdev.com.au

Twitter: twitter.com/astroboysoup
Facebook: www.facebook.com/pbwebdev

Re:Redirects 2 years, 2 months ago #2628

  • Laurie
  • OFFLINE
  • Expert Boarder
  • Posts: 130
  • Karma: 3
OK, thanks Fellas. I've got the non www to www working.

Now, the index.php redirect. What do I need to do there? I see some stuff toward the top of the .htaccess file that prevents stuff, but I don't understand it.

Thanks,
Laurie.
On the way to being a basic Joomla user.
www.australianexplorers.com.au/

Re:Redirects 2 years, 2 months ago #2629

  • Laurie
  • OFFLINE
  • Expert Boarder
  • Posts: 130
  • Karma: 3
Ah success!

With a bit of help from my host, a bit more from here and a bit of help from a nice fella with a site indexed in Google, I got it.

www.corepressure.com/joomla-15/joomla-15...-joomla-15-urls.html A great recourse for anyone else doing this.

Here's what I finished up with, for what it's worth:
##  Can be commented out if causes errors, see notes above.
Options +FollowSymLinks
 
#
# mod_rewrite in use

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.southimage\.net
RewriteRule ^(.*)$ http://www.southimage.net/$1 [R=301,L]
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.southimage.net/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Redirect 301 /home.html http://www.southimage.net/


This gives me:
* all non www pages redirected to their www version
* www.site.net/index.php redirected to www.site.net/
* www.site.net/home.html redirected to www.site.net/

So that's taken care of some duplicate content issues. Anything else I should know about?

Thanks for the help. Much appreciated.

Laurie.
On the way to being a basic Joomla user.
www.australianexplorers.com.au/

Re:Redirects 2 years, 2 months ago #2630

  • buipy001
  • OFFLINE
  • Administrator
  • Posts: 250
  • Karma: 12
SH404Sef can also do all of that for you as well.
extensions.joomla.org/extensions/10134
The only limitation is your imagination
www.pbwebdev.com.au

Twitter: twitter.com/astroboysoup
Facebook: www.facebook.com/pbwebdev

Re:Redirects 2 years, 2 months ago #2631

  • RicRaftis
  • OFFLINE
  • Expert Boarder
  • Posts: 146
  • Karma: 5
Sorry I missed this post earlier, I might have been able to save you some mucking around.

1. You can do a permanent 301 redirect in you cPanel for all non www to www. or vice versa. Much easier than getting all the code for the .htaccess file.

2. In Google webmaster tools, you can also tell Google that you want all urls displayed as either www or without in their index.

3. There shouldn't be any problem with "duplicate content" anyway. This was a problem some time ago when the search engines couldn't tell the difference between the pages. They are a lot smarter now though and recognize that a page with www is the same as the url without it. Still doesn't hurt to do the 301 redirect in cPanel anyway.

Cheers,
Now Retired but still interested...
Follow me on Twitter

Re:Redirects 2 years, 2 months ago #2632

  • Laurie
  • OFFLINE
  • Expert Boarder
  • Posts: 130
  • Karma: 3
Thanks Rick.

1. You can do a permanent 301 redirect in you cPanel for all non www to www. or vice versa. Much easier than getting all the code for the .htaccess file.


Yes, that's what I understood. In fact, I was sure I had it all sorted a few weeks ago in cPanel. But it all just disappeared and when I contacted the host, well, that's where I finished up. Dunno.

2. In Google webmaster tools, you can also tell Google that you want all urls displayed as either www or without in their index.


Yes, I've tried many times to do this. I can get the .net set to Australia OK but when I try to set the www option it says the site isn't verified. Well, of course it's verified! I've only ten seconds before set it to Australia!

I'll try again, now that I've got the redirects sorted correctly.

3. There shouldn't be any problem with "duplicate content" anyway. This was a problem some time ago when the search engines couldn't tell the difference between the pages. They are a lot smarter now though and recognize that a page with www is the same as the url without it. Still doesn't hurt to do the 301 redirect in cPanel anyway.


Interesting to hear you say that. It stands to reason that in the attempt to deliver the best results, Google and others shouldn't downgrade a site for such a silly thing as the inevitable duplicates.

I'm clutching at straws here a bit.

My original domain and site used to perform really well in Google. #2 to #7 on page one for my main keywords. Then it dropped off. Mind you, I did some strange things such as joining Blogsvertise. I may have been linking out to some bad neighborhoods, link wise.

It was a hand coded, html site. I recently deleted the lot: 1,500 pages or so, though I still have a couple of blogs in subfolders. Slowly rebuilding in Joomla.

Funny thing: I rank on page 1 in Yahoo and Bing for most keywords but I'm way down the back paddock in Google.

So that's what's behind my actions. Any thoughts?
On the way to being a basic Joomla user.
www.australianexplorers.com.au/

Re:Redirects 2 years, 2 months ago #2634

  • ywsolution
  • OFFLINE
  • Expert Boarder
  • Posts: 105
  • Karma: 5
Redirects in cPanel write the code to your .htaccess file - I find cPanel puts this at the end and with Joomla rewrite turned on the rewrite to www doesn't work unless you move the www rewrite code to just after the command to turn rewrite on.

Re:Redirects 2 years, 2 months ago #2635

  • Laurie
  • OFFLINE
  • Expert Boarder
  • Posts: 130
  • Karma: 3
Thanks ycs.

Yes, it must be that when I first had the redirects working that I had just got the Joomla site going and hadn't yet activated the SEF, or something like that, so the ReWrite was at the top.

Anyway, that's all sorted now.

I'll soon be able to call myself an expert Joomla Noob at this rate, huh!

As an aside, let me say that I really appreciate the help I've got from this forum. It has the feel of highly competent people who are not condescending or superior.

I'd really like to go to one of the monthly meetings but it's three hours drive each way to the nearest one at Canberra which is rather a long drive for an hour and a half meeting and a cup of coffee.
On the way to being a basic Joomla user.
www.australianexplorers.com.au/
  • Page:
  • 1
Time to create page: 0.83 seconds
You are here: Forum