vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   .htaccess help for rewrites / redirect (https://vborg.vbsupport.ru/showthread.php?t=267805)

sportsfroma2 08-02-2011 02:15 AM

.htaccess help for rewrites / redirect
 
Hi,

question for those that are versed in .htaccess files and redirection-

I just moved my vB suite install from a folder (www.mysite.com/forums) to the root.

Also, I'm using the Mod Rewrite Friendly URL option, with the vbulletin-supplied .htaccess file.

1) What's the best way to ensure external links will be able to reach the "new" location? Like for example, http://www.mysite.com/forums/threads...blah-blah-blah would automatically go to http://www.mysite.com/threads/1111-t...blah-blah-blah (same URL, just without the /forums)
I tried a could of things that I found from google or whatever and just ended up getting 500 errors so figured I'd consult the experts here become continuing to experiment

2) This request isn't as important as #1, but I also recently finally totally migrated my content from an old CMS system to vBulletin's CMS, and wanted to know if there's a simple way to redirect my article links..
EX: one article was located at: http://mysite.com/index.php?option=c...-bio&Itemid=63, and the vbulletin CMS entry is at: http://www.mydomain.com/content/336-blah-blah-blah . I figured there isn't a rule that'll automatically change these URL's but I should at least be able to set up a permanent redirect for them in the .htaccess file, but messed that up also.

My current .htaccess file looks like this, if it matters:

Code:

RewriteEngine on

<Files 403.shtml>
order allow,deny
allow from all
</Files>

deny from 12.345.678.

# If you are having problems or are using VirtualDocumentRoot, uncomment this line and set it to your vBulletin directory.
# RewriteBase /forum/

# If you are having problems with the rewrite from content/ to content.php, uncomment this line to turn MultiViews off.
# Options -MultiViews

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^.*$ - [NC,L]

# Forum
RewriteRule ^threads/.* showthread.php [QSA]
RewriteRule ^forums/.* forumdisplay.php [QSA]
RewriteRule ^members/.* member.php [QSA]
RewriteRule ^blogs/.* blog.php [QSA]
RewriteRule ^entries/.* entry.php [QSA]

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^.*$ - [NC,L]

# MVC
RewriteRule ^(?:(.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA]

(BTW, Yes, I replaced the deny IP address with a fake one, so don't be alarmed with that, lol)

Thanks a lot for looking at this!


All times are GMT. The time now is 11:16 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.00912 seconds
  • Memory Usage 1,714KB
  • 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
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete