Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-25-2008, 06:29 PM
TacticalNuke TacticalNuke is offline
 
Join Date: Mar 2007
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default htaccess for several things

Alright so currently I have my .htaccess file set up for vbseo sitemap, I have it set as unreadable, and I have it redirect the old Zoints tags system to the new built-in tags system.

However, I have two problems. One, I want to redirect site.com to www.site.com.

The other problem is that .com is PR 2 and .com/index.php is PR 1. I'm assuming I should set a redirect from index.php to the plain .com but I'm not sure how to do that.

I saw this code for the www issue in another thread:
Code:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !www\.example\.com [NC]
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
And here is my current .htaccess:

Code:
RewriteEngine On
RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

<Files .htaccess>
order allow,deny
deny from all
</Files>

Redirect /tags/ http://www.serviceacademyforums.com/tags.php
Can anybody help me add the redirect to www and help me decide if I should direct to index.php or plain .com and how to do that?

Thanks, I'd really appreciate it.

--------------- Added [DATE]1217030827[/DATE] at [TIME]1217030827[/TIME] ---------------

I'm sorry, this probably should have gone in the programming section, could a mod please move it? Thanks.
Reply With Quote
  #2  
Old 07-26-2008, 05:27 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
RewriteEngine On

RewriteCond %{HTTP_HOST} example\.com [NC]
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

<Files .htaccess>
order allow,deny
deny from all
</Files>

Redirect /tags/ http://www.serviceacademyforums.com/tags.php
Reply With Quote
  #3  
Old 07-26-2008, 10:49 AM
TacticalNuke TacticalNuke is offline
 
Join Date: Mar 2007
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks a lot for the help. One last question, how (and should I) would I redirect .com/index.php to .com?

For some reason PR on just the .com is 2, while /index.php is 1. I'm not sure if this is a big deal or not, so maybe I don't need to do it at all.
Reply With Quote
  #4  
Old 07-26-2008, 10:49 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Don't worry about it IMO.
Reply With Quote
  #5  
Old 07-26-2008, 10:52 AM
TacticalNuke TacticalNuke is offline
 
Join Date: Mar 2007
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
Don't worry about it IMO.
Sounds good, thanks again for all the help and the quick responses.
Reply With Quote
  #6  
Old 07-27-2008, 06:04 PM
TacticalNuke TacticalNuke is offline
 
Join Date: Mar 2007
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So I tried using that redirect, replacing example with my website name, but I got an error in firefox that the redirect will "never complete".

I'm wondering if I didn't put in the information correctly, or if there's something wrong with the coding that I took from somewhere else.
Reply With Quote
  #7  
Old 07-28-2008, 06:19 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
RewriteEngine On

RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

<Files .htaccess>
order allow,deny
deny from all
</Files>

Redirect /tags/ http://www.serviceacademyforums.com/tags.php
Reply With Quote
  #8  
Old 07-28-2008, 10:45 AM
TacticalNuke TacticalNuke is offline
 
Join Date: Mar 2007
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you again.

I have one final question (I know, lots of questions).

I thought I had my old tags redirecting properly, but google webmaster tools has a bunch of not found urls, 509 to be exact.

They all look like this:

http://www.serviceacademyforums.com/...-time-through/
http://www.serviceacademyforums.com/...2-nominations/
http://www.serviceacademyforums.com/...08-graduation/

etc....

Once those links are clicked, they "change":

http://www.serviceacademyforums.com/...08-graduation/

like so. So /tags/ isn't redirecting them. I tried a /tags. but that didn't work.

It almost seems like the /tags/ redirect is redirecting them but there's a problem. Instead of just redirecting them to the main tags area, it's appending whatever comes after the /tags/ to the redirect location (in this case /tags.php) so I end up with /tags.index.php/*******

I'm guessing my redirect is improperly formed, I hope this makes sense. I've tried a number of permutations but basically I just want any /tags to redirect to http://www.serviceacademyforums.com/tags.php without appending whatever else was on the link to the end of it.

As always, I really appreciate it, I don't know what I'd do without this forum.
Reply With Quote
  #9  
Old 07-28-2008, 11:52 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you give me a "before and after" of the link (of what it is supposed to look like).
Reply With Quote
  #10  
Old 07-28-2008, 05:29 PM
TacticalNuke TacticalNuke is offline
 
Join Date: Mar 2007
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not found URL:

[not url]http://www.serviceacademyforums.com/tags/index.php/1st-time-through/[/url]

These are all (I'm assuming) leftovers of the Zoints tag system. I used one of the mods here to import them all to the vB tags system, but google still has some of the links.

I wanted to redirect to:

[not url]http://www.serviceacademyforums.com/tags.php/[/url]

As I think this makes the most sense, if someone is searching for tags to begin with this seems like a good place to send them.

My current .htaccess redirect is:

Code:
#redirecting old zoints tags to vb tags
Redirect /tags http://www.serviceacademyforums.com/tags.php/
The trouble is this makes the links look as such:

[not url]http://www.serviceacademyforums.com/tags.php//index.php/1st-time-through/[/url]

So it's appending what comes after (/index.php/1st-time-through/) to the redirect location.

I've tried several wildcard redirects that I found through google searching, but all of them give me errors and don't work. I don't understand redirects very well though.

As always, I appreciate the help.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:10 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04878 seconds
  • Memory Usage 2,260KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (5)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete