1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.2 Linked image to server

Discussion in 'XenForo Questions and Support' started by tommydamic68, Oct 6, 2013.

  1. tommydamic68

    tommydamic68 Well-Known Member

    Last edited: Oct 6, 2013
  2. Mike

    Mike XenForo Developer Staff Member

    It's a redirection of some sort that you must have set up in Apache.
     
  3. tommydamic68

    tommydamic68 Well-Known Member

    The only redirection was from @Jake Bunce in my .htaccess file. I believe it was this

    Code:
    RewriteEngine On
    
    RewriteRule ^[^/]+/.+-([0-9]+)/$ /community/index.php?threads/$1/ [R=301,L]
    RewriteRule ^forum\.php$ /community/ [R=301,L]
    RewriteRule ^.*$ /community/ [R=301,L]
    # Use PHP 5.3
    AddType application/x-httpd-php53 .php
    
     
  4. Mike

    Mike XenForo Developer Staff Member

    Well the last rule listed there would redirect every URL it hits to /community/.
     
  5. tommydamic68

    tommydamic68 Well-Known Member

    That is what @Jake Bunce gabe to me to help get my site going after new install- unfortunately I am lost with the proper redirect code. Any advice @Mike ?
     
  6. Jeremy

    Jeremy XenForo Moderator Staff Member

    What directory was your old forum installed in?
     
  7. tommydamic68

    tommydamic68 Well-Known Member

  8. tommydamic68

    tommydamic68 Well-Known Member

    It was vb by the way.
     
  9. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    It appears vB was in the web root?

    You could remove the catch all:

    Code:
    RewriteEngine On
    
    RewriteRule ^[^/]+/.+-([0-9]+)/$ /community/index.php?threads/$1/ [R=301,L]
    RewriteRule ^forum\.php$ /community/ [R=301,L]
    RewriteRule ^.*$ /community/ [R=301,L]
    # Use PHP 5.3
    AddType application/x-httpd-php53 .php
    
    Or you can add another line to exclude specific root directories:

    Code:
    RewriteEngine On
    
    RewriteRule ^[^/]+/.+-([0-9]+)/$ /community/index.php?threads/$1/ [R=301,L]
    RewriteRule ^forum\.php$ /community/ [R=301,L]
    RewriteRule ^(images)/.*$ - [S=1]
    RewriteRule ^.*$ /community/ [R=301,L]
    # Use PHP 5.3
    AddType application/x-httpd-php53 .php
    
    If you want to exclude multiple root directories then use a pipe, like this:

    Code:
    RewriteEngine On
    
    RewriteRule ^[^/]+/.+-([0-9]+)/$ /community/index.php?threads/$1/ [R=301,L]
    RewriteRule ^forum\.php$ /community/ [R=301,L]
    RewriteRule ^(images|dir2|dir3|dir4)/.*$ - [S=1]
    RewriteRule ^.*$ /community/ [R=301,L]
    # Use PHP 5.3
    AddType application/x-httpd-php53 .php
    
     
    Mike likes this.
  10. tommydamic68

    tommydamic68 Well-Known Member

    Here is my whole .htaccess file. What would be best? And, can I remove some of this garble from years of who knows what?

    Code:
    RewriteEngine On
    
    RewriteRule ^[^/]+/.+-([0-9]+)/$ /community/index.php?threads/$1/ [R=301,L]
    RewriteRule ^forum\.php$ /community/ [R=301,L]
    RewriteRule ^.*$ /community/ [R=301,L]
    # Use PHP 5.3
    AddType application/x-httpd-php53 .php
    
    # Ticket PBB-18872701
    <IfModule mod_suphp.c>
      suPHP_ConfigPath /home/admin/public_html
      <Files php.ini>
        order allow,deny
        deny from all
      </Files>
    </IfModule>
    # Ticket PBB-18872701
    
    DirectoryIndex index.php
    #RewriteEngine Off
    
    # Comment the following line (add '#' at the beginning)
    # to disable mod_rewrite functions.
    # Please note: you still need to disable the hack in
    # the vBSEO control panel to stop url rewrites.
    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} ^mysite.com$
    RewriteRule ^/?$ "http\:\/\/www\.mysite\.com\/" [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^mysite.com$
    RewriteRule ^forum\.php\/?(.*)$ "http\:\/\/www\.mysite\.com\/forum\.php$1" [R=301,L]
    
    # Some servers require the Rewritebase directive to be
    # enabled (remove '#' at the beginning to activate)
    # Please note: when enabled, you must include the path
    # to your root vB folder (i.e. RewriteBase /forums/)
    #RewriteBase /
    
    #RewriteCond %{HTTP_HOST} !^www\.mysite\.com
    #RewriteRule (.*) http://www.mysite.com/$1 [L,R=301]
    
    RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
    
    RewriteCond %{REQUEST_URI} !(aol/|not/|cron|vbseo_sitemap)
    RewriteRule ^((archive/)?(.*\.php(/.*)?))$ vbseo.php [L,QSA]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !/(note|note|clientscript|cpstyles|images)/
    RewriteRule ^(.+)$ vbseo.php [L,QSA]
    
    <Files 403.shtml>
    order allow,deny
    allow from all
    </Files>
    
    deny from 71.20
    deny from 71.5
    deny from 71.2
    deny from 20
    deny from 24.2
    deny from 184
    deny from 68
    deny from 74.1
    deny from 71.20
    deny from 96
    deny from 99.1
    deny from 50.5
    deny from 75
    deny from 24.
    
    RewriteCond %{HTTP_USER_AGENT} ^Baiduspider.* [NC]
    
    #RewriteCond %{HTTP_HOST} ^mysite.com$
    #RewriteRule ^/?$ "http\:\/\/www\.mysite\.com\/" [R=301,L]
    
    #RewriteCond %{HTTP_HOST} ^mysite.com$
    #RewriteRule ^forum\.+\/?(.*)$ "http\:\/\/www\.mysite\.com\/forum\.php$1" [R=301,L]
    # Expire images header
    ExpiresActive On
    ExpiresDefault A0
    ExpiresByType image/gif A2592000
    ExpiresByType image/png A2592000
    ExpiresByType image/jpg A2592000
    ExpiresByType image/jpeg A2592000
    ExpiresByType image/ico A2592000
    ExpiresByType text/css A2592000
    ExpiresByType text/javascript A2592000
    # compress text, html, javascript, css, xml:
    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
    
    # Or, compress certain file types by extension:
    <files *.html>
    SetOutputFilter DEFLATE
    </files>
    
    RewriteEngine On
    RewriteRule ^Microsoft-Server-ActiveSync$ hgpush/index.php
     
  11. tommydamic68

    tommydamic68 Well-Known Member

    yes i believe it was in the webroot.
     
  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Old vBSEO rewrites. They don't cause any harm.

    I suggest the exclusion list like I posted.
     
  13. tommydamic68

    tommydamic68 Well-Known Member

    So i will add this code here -just add it above all else in the file? Or remove and replace the original redirect you had given me.

    Code:
    RewriteEngine On
    
    RewriteRule ^[^/]+/.+-([0-9]+)/$ /community/index.php?threads/$1/ [R=301,L]
    RewriteRule ^forum\.php$ /community/ [R=301,L]
    RewriteRule ^(images|dir2|dir3|dir4)/.*$ - [S=1]
    RewriteRule ^.*$ /community/ [R=301,L]
    # Use PHP 5.3
    AddType application/x-httpd-php53 .php
     
  14. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Add the blue line in the location shown, inside of your existing .htaccess file in the web root. I put it in context so you know exactly where to add the new line.
     
    tommydamic68 likes this.
  15. tommydamic68

    tommydamic68 Well-Known Member

    Ok done! Hope it works - i used the second one.

    Code:
    RewriteEngine On
    
    RewriteRule ^[^/]+/.+-([0-9]+)/$ /community/index.php?threads/$1/ [R=301,L]
    RewriteRule ^forum\.php$ /community/ [R=301,L]
    RewriteRule ^(images|dir2|dir3|dir4)/.*$ - [S=1]
    RewriteRule ^.*$ /community/ [R=301,L]
    # Use PHP 5.3
    AddType application/x-httpd-php53 .php
     

Share This Page