vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   htaccess for several things (https://vborg.vbsupport.ru/showthread.php?t=186360)

TacticalNuke 07-25-2008 06:29 PM

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.

Dismounted 07-26-2008 05:27 AM

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


TacticalNuke 07-26-2008 10:49 AM

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.

Dismounted 07-26-2008 10:49 AM

Don't worry about it IMO.

TacticalNuke 07-26-2008 10:52 AM

Quote:

Originally Posted by Dismounted (Post 1584557)
Don't worry about it IMO.

Sounds good, thanks again for all the help and the quick responses.

TacticalNuke 07-27-2008 06:04 PM

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.

Dismounted 07-28-2008 06:19 AM

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


TacticalNuke 07-28-2008 10:45 AM

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.

Dismounted 07-28-2008 11:52 AM

Can you give me a "before and after" of the link (of what it is supposed to look like).

TacticalNuke 07-28-2008 05:29 PM

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. :)


All times are GMT. The time now is 12:26 AM.

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.01042 seconds
  • Memory Usage 1,740KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (5)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete