Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-28-2014, 07:58 AM
xony xony is offline
 
Join Date: Mar 2005
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default write a rule

How to write a rule to redirect url the first to the second? thanks for the help.

http://www.foro3d.com/post/722216-Cr...cana-Planet-51

http://www.foro3d.com/threads/81976-...l=1#post722216
Reply With Quote
  #2  
Old 07-28-2014, 09:09 AM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It would have been a good thing to put the urls inside code tags, so they don't get linked and shortened.

Code:
http://www.foro3d.com/post/722216-Critica-Americana-Planet-51
Code:
http://www.foro3d.com/threads/81976-Critica-Americana-Planet-51?p=722216&viewfull=1#post722216
If a redirect via htaccess is what you're looking for, that's not possible since the threadid (81976) is not present in the originating URL.
Reply With Quote
  #3  
Old 07-28-2014, 09:40 AM
xony xony is offline
 
Join Date: Mar 2005
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for your help, greetings friend.
Reply With Quote
  #4  
Old 07-29-2014, 10:21 PM
Rafa-el's Avatar
Rafa-el Rafa-el is offline
 
Join Date: Feb 2010
Location: Nicaragua
Posts: 170
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cellarius View Post
It would have been a good thing to put the urls inside code tags, so they don't get linked and shortened.

Code:
http://www.foro3d.com/post/722216-Critica-Americana-Planet-51
Code:
http://www.foro3d.com/threads/81976-Critica-Americana-Planet-51?p=722216&viewfull=1#post722216
If a redirect via htaccess is what you're looking for, that's not possible since the threadid (81976) is not present in the originating URL.
Sorry to contradict. But that doens't matter since he's redirecting to the post URL not the thread.

@OP, Try to play around with this:

Code:
RewriteRule /post/([0-9]+)-([\d]+)\ /showthread.php?=$1#post$1 [NC,L]
If it doesn't work let me know, it's also possible to make a rewrite but you get the basics with that one.

Rafael
Reply With Quote
  #5  
Old 07-30-2014, 06:06 AM
cellarius's Avatar
cellarius cellarius is offline
 
Join Date: Aug 2005
Posts: 1,987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I know that it is possible to access a post in this way, but that is not the URL he wants to redirect to, is it? He asked for a redirection to a specific form of URL.
Reply With Quote
  #6  
Old 07-30-2014, 06:51 PM
xony xony is offline
 
Join Date: Mar 2005
Posts: 99
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Rafael, unfortunately does not work.

I want to redirect all post / in general, which was to put an example, there are actually many more.

If you think there may be a rewrite solution, please help me, I am willing to compensate you.


This is my htaccess:


Code:
Options +FollowSymLinks
Options +Indexes
# AddDefaultCharset utf-8

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

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

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

RewriteRule ^.*$ - [NC,L]

RewriteRule ^blogs/.* blog.php [QSA]
RewriteRule ^entries/.* entry.php [QSA]

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


RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]

# para redirigir url antiguas----------------
RewriteEngine on
RewriteRule f[\d]+/.+-([\d]+)-([\d]+).html showthread.php?t=$1&page=$2 [NC,L]
RewriteRule f[\d]+/.+-([\d]+).html showthread.php?t=$1 [NC,L]
RewriteRule f([\d]+)/i([\d]+).html forumdisplay.php?f=$1&page=$2 [NC,L]
RewriteRule f([\d]+)/ forumdisplay.php?f=$1 [NC,L]
# fin redirigir url antiguas------------------------------

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


# Turn on Expires and set default to 0
ExpiresActive On
ExpiresDefault A0
 
# Set up caching on media files for 1 year (forever?)
<filesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$">
ExpiresDefault A29030400
Header append Cache-Control "public"
</filesMatch>
 
# Set up caching on media files for 1 week
<filesMatch "\.(gif|jpg|jpeg|png|swf)$">
ExpiresDefault A604800
Header append Cache-Control "public"
</filesMatch>
 
# Set up 2 Hour caching on commonly updated files
<filesMatch "\.(xml|txt|html|js|css)$">
ExpiresDefault A604800
Header append Cache-Control "proxy-revalidate"
</filesMatch>
 
# Force no caching for dynamic files
<filesMatch "\.(php|cgi|pl|htm)$">
ExpiresActive Off
Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
Header set Pragma "no-cache"
</filesMatch>

<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</ifmodule>

<FilesMatch "\.(ico|gif|jpg|png|flv|pdf|mp3|js|css|xml)$">
  Header set Cache-Control "max-age=2592000"
  Header always unset Set-Cookie
  Header unset ETag
  FileETag None
</FilesMatch>

<ifModule mod_headers.c>
    Header set Connection keep-alive
</ifModule>

redirect 301 /f121 http://www.foro3d.com/forums/121-Maya/
redirect 301 /f111 http://www.foro3d.com/forums/111-Blender/
redirect 301 /f36 http://www.foro3d.com/forums/36-Mercadillo-del-Foro
redirect 301 /f254 http://www.foro3d.com/forums/254-Blueprints
redirect 301 /f114 http://www.foro3d.com/forums/114-Acepta-el-Reto
redirect 301 /f143 http://www.foro3d.com/forums/143-Rhino
redirect 301 /f125 http://www.foro3d.com/forums/125-Adobe-Premiere
redirect 301 /f112 http://www.foro3d.com/forums/112-3DStudio-Max
redirect 301 /f135 http://www.foro3d.com/forums/135-ZBrush
redirect 301 /f152 http://www.foro3d.com/forums/152-Cinema-4D
redirect 301 /portafolio/ http://www.foro3d.com/blog.php?/
redirect 301 /etiquetas/ http://www.foro3d.com/tags/
redirect 301 /f150 http://www.foro3d.com/forums/150-After-Effects
redirect 301 /f153 http://www.foro3d.com/forums/153-InKscape
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 01:58 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.03582 seconds
  • Memory Usage 2,222KB
  • 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
  • (6)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete