PDA

View Full Version : Mini Mods - Force www. (without .htaccess)


1Unreal
09-09-2009, 10:00 PM
This mod will redirect users who do not have the www. subdomain to one that does. This helps with SEO as it stops duplicate content also fixes some logging in issues. Another upside is that this is done with pure PHP so you don't need to mess about with .htaccess.

There are no options, just upload it and it will redirect the users straight away.

Please post any issues and don't forget to click install!

HMBeaty
09-10-2009, 06:23 PM
Nice thanks. Installed!

Mohsen71
09-10-2009, 09:15 PM
thanks. Installed!

Eruantien
09-10-2009, 10:27 PM
Sweet!

JVCode
09-10-2009, 10:29 PM
Thank you, Installed.

yahoooh
09-10-2009, 11:48 PM
i think it will affect any one use subdomains for vba links ,vbgallery and others

al-Rsha.com
09-11-2009, 12:23 AM
I have a question that is ,
dose the mod effect sub domains
and the parked domains ;)

legion!
09-11-2009, 03:27 AM
i installed this and i cannot log into my admin panel now because of it...it jus redirects me to my forumhome....

HMBeaty
09-11-2009, 03:33 AM
i installed this and i cannot log into my admin panel now because of it...it jus redirects me to my forumhome....
Try disabling your modifications by placing this UNDER <?php in your includes/config.php file
define('DISABLE_HOOKS', true);
Then go to your AdminCP and uninstall

legion!
09-11-2009, 03:44 AM
i jus did that...and it didnt work...all my hacks and stuff are still workin...and i cant log into the CPanel

New Joe
09-11-2009, 09:59 AM
Anyone else have this same problem?

legion!
09-11-2009, 10:31 AM
im still locked out of my panel...is there anyway to reverse this

choccyclaire
09-11-2009, 11:05 AM
Try accessing your site via your ip?

Hostboard
09-11-2009, 04:36 PM
Most likely this is cached in your browser. You can try:

1. Clear browsers cache and cookies
2. Try another browser
3. Force a refresh (F5, ctrl r, etc.)

Brandon Sheley
09-11-2009, 05:00 PM
I would suggest you also change this in google webmaster tools (www.google.com/webmasters/tools/) as well :)

1Unreal
09-11-2009, 11:55 PM
i think it will affect any one use subdomains for vba links ,vbgallery and others

Yes it will.

I have a question that is ,
dose the mod effect sub domains
and the parked domains ;)

It will effect sub-domains as www is a sub domain.

i jus did that...and it didnt work...all my hacks and stuff are still workin...and i cant log into the CPanel

Try going to http://www.yoursite.com/cpanel instead of http://cpanel.yoursite.com/

Chuta
09-13-2009, 01:29 AM
Good Bye Login Problems!!

ag24
09-13-2009, 05:20 AM
nice work,tnx
installed...

ravi_9793
09-13-2009, 05:33 PM
Thanks, working. :)

Manoel J?nior
09-13-2009, 07:13 PM
Very, very, very Thanks!!!!

Great my bro!

MissKalunji
09-15-2009, 12:49 AM
Seems to be working perfectly!

Thank you!

hpidriver
09-15-2009, 10:01 PM
Just to make sure, i upload this as a product???

MissKalunji
09-15-2009, 10:51 PM
Yep as a product

cosy
09-17-2009, 06:11 PM
dont working for me

vboptimize can be a problem ?

MissKalunji
09-17-2009, 09:03 PM
it could be

EagleNick
09-19-2009, 11:40 AM
How does this mod work, exactly? People have been asking in this thread on another site: http://www.adminaddict.net/forum/vbulletin/opinions-mod-search-engine-optimization-3471/

MoMan
09-23-2009, 04:04 AM
FYI if I try to access my site via IP, the www. is still appended, thus making the site inaccessible. Might want to make a conditional to get around that somehow!

MoMan
09-23-2009, 04:40 AM
Fixed this by wrapping the entire plugin code in this conditional:

$pos = strpos($_SERVER['HTTP_HOST'],'*your website IP address here*');
if ($pos === false)
{*plugin code here* }
else
{}

bigcurt
09-27-2009, 04:24 AM
^^ I concur with what he said, just checked it on my site as well.

teuor
09-27-2009, 06:56 AM
nice work, thanks

Entonadoscl
10-19-2009, 02:24 AM
thanks ;)

nonspin
10-24-2009, 12:13 AM
.. just for ticks and for those who prefer the proper .htaccess method

# Redirect adding leading www.to domain or any subdomain if missing
# RewriteEngine On
RewriteCond %{HTTP_HOST} !^www..
Rewriterule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

Remove "#" from RewriteEngine On if not present

Quantnet
10-24-2009, 11:21 AM
How does this mod work without the .htaccess modification? I'm curious.

1Unreal
10-24-2009, 12:27 PM
How does this mod work without the .htaccess modification? I'm curious.

Well using PHP you can get the current URL of a page and you can redirect. Simple :)

AdamCap
01-02-2010, 07:28 PM
I was a little worried about installing this after reading some of the comments with troubles...but it works perfectly for me! I couldn't get my .htaccess to redirect, so this is awesome. :)

I think my .htaccess redirect problems might have have something to do with wordpress. It's installed in my root and automatically redirects all wordpress pages to www, so for some reasons adding the code to redirect in htaccess wouldn't redirect vBulletin which is in a folder off the root.

EliasAlucard
01-25-2010, 01:15 AM
This plugin is not working properly.

KyleWhitey
01-27-2010, 01:19 AM
installed, awesome dude thx

CORSO
02-19-2010, 03:18 PM
work with 4.0.2?

MrPHD
02-19-2010, 04:19 PM
This mod run on vbulletin 4.0.x version.

ravenfaust
02-21-2010, 06:13 PM
not working for me, stays without www.

Manoel J?nior
03-13-2010, 02:02 PM
Working in vbb4.x

Great!!

bluecat
04-04-2010, 11:14 PM
works on 4.0.2 thanks :D

kpmedia
10-22-2010, 08:42 PM
This works even when my .htaccess would not. Excellent!
Just what I was needing. Thanks.

Cybershaolin
10-24-2010, 12:45 AM
Fixed this by wrapping the entire plugin code in this conditional:

$pos = strpos($_SERVER['HTTP_HOST'],'*your website IP address here*');
if ($pos === false)
{*plugin code here* }
else
{}


I'm not quite sure where or how to integrate this with the product posted. Would it be possible to write down the whole product code with this modification please?

EWGF
10-24-2010, 07:30 PM
This is exactly what I've been looking for. Every single .htaccess that I've tried, couldn't redirect all the following situations:

mysite.com/forum
->
www.mysite.com/forum

mysite.com/forum/forumdisplay.php?f=1
->
www.mysite.com/forum/forumdisplay.php?f=1

mysite.com/forum/showthread.php?t=12345&page=6
->
www.mysite.com/forum/showthread.php?t=12345&page=6

erel34
01-06-2011, 04:04 PM
thanks. Installed!

Guest20210129
02-08-2011, 04:35 PM
thanks ;)

Alfa1
02-08-2011, 11:55 PM
This doesn't work with https. It forces http as well. How can I solve this?

EWGF
02-26-2011, 01:52 PM
Edit the plugin by adding a "s" after every "http" in the plugin

Aexo
09-06-2011, 02:18 PM
Working perfectly in vbulletin 4!!!

Mark_Zuckerberg
10-06-2011, 03:33 PM
Thanks a lot mate this solved my invalid redirect url problem thank you so much :)

final kaoss
06-21-2012, 12:41 AM
Works great with vb 4, thanks!

Needed this for cloudflare which only does rewrites on www urls.

Mark_Zuckerberg
10-01-2012, 02:45 PM
Its not working on vb 4.2 any suggestions
my domain opens at
www.mydomain.com
www.mydomain.com/forum.php
www.mydomain.com/forum.php?

i want it to be www.mydomain.com in all manners.

Guest20210129
12-29-2012, 03:52 PM
Not working in vB 4.2.0 :(

Please, this plugin is a must, suppor it! :)

Max Taxable
12-29-2012, 04:32 PM
Pardon my ignorance, but why is www preferred and not just the http?

bbgun1
05-23-2013, 04:49 PM
Hi - Is this no longer supported? Doesn't seem to work with vB5 unfortunately.

Anyone else have any luck getting it going on vB5?