WFruit | Fruit Supplier and Wholesale
نمایش نتایج: از 1 به 3 از 3

موضوع: درخواست هک Custom SEO urls (mod_rewrite only)

  1. Top | #1
    کاربر سایت

    تاریخ عضویت
    Jan 2012
    ورژن ویبولتین
    4
    نوشته ها
    4
    مورد پسند
    4 بار
    اطلاعات
    میزان امتیاز
    0

    پیش فرض درخواست هک Custom SEO urls (mod_rewrite only)

    با سلام
    بنده به هک Custom Search Engine Optimization urls (mod_rewrite only) نیاز دارم.
    کار این هک تغییر شکل آدرس صفحات ویبولتین هست. در آدرس زیر:
    http://www.vbulletin.org/forum/showt..._rewrite+only)

    با تشکر

    کاربر مقابل از mohamad110 بابت این پست مفید تشکر کرده است:





  2. گیفت کارت آیتونز

  3. Top | #2
    مدیر ارشد

    تاریخ عضویت
    Oct 2010
    ورژن ویبولتین
    v4.1.3 PL8
    نوشته ها
    6,803
    مورد پسند
    11,661 بار
    نوشته های وبلاگ
    63
    اطلاعات
    میزان امتیاز
    937

    پیش فرض

    What does this do?
    This mod allows you to define the beginning part of all the friendly urls. Eventually, more of the url may be customizable but this should be enough to provide a nice structure to your site anyway. I have now released this as more of a mod to make it easier for the less technical admins.

    What use is this to me?
    I can see a couple of major uses here.
    1. If you want to translate the friendly urls into your local language (so instead of having http://example.com/threads/123-Test-Thread/ you have http://example.com/[translation]/123-Test-thread)
    2. You want a bit more structure to your links eg forum/threads, forum/posts, blogs/entries etc
    3. You just don't like the defaults you've been stuck with and want to change to t,p,f,b and e

    Installation
    1. First step here, is to ensure that the default mod rewrite urls work for you. Upload the default .htaccess file from the do_not_upload folder to your forums and switch on mod rewrite friendly urls in the server settings and optimisations area of your control panel.
    2.Browse around your forums and check that all the links still work. (If they don't you need to work with vb support and your host to get them working)
    3. Upload the contents of the upload folder in the zip.
    4. Import the product.
    5. There is now a new option group in your admin cp; friendly url settings. Change these to your liking.
    5a. There is also a link to the rewrite rule generator from the settings page; once you've got the settings to your liking, visit the link to generate a .htaccess file. Alternativly follow the instructions below to make your own.
    6. Once you've made these changes, you need to edit your .htaccess file rewrite rules to reflect the changes you made. You need to replicate the change to this file that you've made to the options. you will see a set of:

    کد:
    RewriteRule ^threads/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) showthread.php?t=$1&page=$2&%{QUERY_STRING}
    RewriteRule ^members/([0-9]+) member.php?u=$1&%{QUERY_STRING}
    RewriteRule ^forums/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) forumdisplay.php?f=$1&page=$2&%{QUERY_STRING}
    RewriteRule ^blogs/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) blog.php?u=$1&page=$2&%{QUERY_STRING}
    RewriteRule ^entries/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) entry.php?b=$1&page=$2&%{QUERY_STRING}
    You need to change the red bits to match your settings.

    7. (Optional) Extra credit. Some people want the /forums/ to point to the forumindex page and /blogs/ to point to blog.php the following rewrite rules will take care of this. These should be added to the .htaccess file (don't overwrite any existing rules, these are new ones)

    کد:
    RewriteRule ^forums/(index.php)?$ forum.php?%{QUERY_STRING}
    RewriteRule ^blogs/(index.php)?$ blog.php?%{QUERY_STRING}
    Finally do a search of your templates + phrases for occurrences of forum.php and blog.php and change them to forums/index.php and blogs/index.php (or forums/ and blogs/) respectively.

    forums.domain.com and blogs.domain.com support
    This is not quite as easy as the above and requires a file edit to achieve.
    If you are using 4.0.1; you can skip the file edit part as it appears to work without.
    1. Make a backup copy of includes/class_friendly_url.php
    2. Around line 604 find:
    کد PHP:
            // REQUEST_URI is dependable for apache
            
    if (isset($_SERVER['REQUEST_URI']))
            {
                
    // return the raw url
                
    $url $_SERVER['REQUEST_URI'];
                
    $url $this->registry->input->strip_sessionhash($url);

                return 
    $url;
            } 
    Replace

    کد PHP:
    $url $_SERVER['REQUEST_URI']; 
    with

    کد PHP:
    $url 'http://' $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 
    3. In your apache config or appropriate server config file, set a serveralias for the subdomains you want to use (eg forums.domain.com) You may need to contact your host for help with this step.
    4. In the vbulletin control panel set the cookie domain to be .yourdomain.com
    I dont know if this will have any knock on effects elsewhere, but it seems to be working for me on my dev board.
    5. You can now set a value for forums to be http://forums.domain.com and blogs to be http://blogs.domain.com or similar based upon your requirement.
    6. Rewrite rules are a bit more complex for this setup; this is a good resource for getting the server side stuff setup: http://www.reconn.us/content/view/46/67/

    example rewrite rules:

    کد:
    RewriteCond %{HTTP_HOST} ^(www.)?forums.domain.com$ [NC]
    RewriteRule ^threads/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) showthread.php?t=$1&page=$2&%{QUERY_STRING}
    RewriteRule ^members/([0-9]+) member.php?u=$1&%{QUERY_STRING}
    RewriteRule ^/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) forumdisplay.php?f=$1&page=$2&%{QUERY_STRING}
    RewriteRule ^/(index.php)?$ forum.php?%{QUERY_STRING}
    
    RewriteCond %{HTTP_HOST} ^(www.)?blogs.domain.com$ [NC]
    RewriteRule ^entries/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) entry.php?b=$1&page=$2&%{QUERY_STRING}
    RewriteRule ^/(index.php)?$ blog.php?%{QUERY_STRING}
    RewriteRule ^/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?)) blog.php?u=$1&page=$2&%{QUERY_STRING}

    Changelog

    4.0-0.1 a4
    Added file to generate rewrite rules
    Removed old instructions from this post to prevent confusion.
    4.0-0.1 a3
    Fixed missing settings in product file.
    4.0-0.1 a2
    Released as product
    4.0-0.1 a1
    Initial release


    Notes

    forums.domain.com and blogs.domain.com is possible, but requires a file edit; Instructions above)
    adding extra information to urls is /not/ currently possible (eg tags, forum name to threads etc)
    if you want a custom url format, post what you would like and if its possible, I can give you more pointers on how to implement it.
    if you change your url format, you may want to leave the old rewrite rules in making a copy of them instead of editing them.
    if you want the old instructions, for manual file edits (advanced users only) pm me.
    There is some experimental code now attached, this provides an example of how to create custom uri formats (includes forum name in thread urls) but is no where near finished and is for advanced users (read coders) only. This functionality will be built into the product once its been tested and is more stable.



    تصاویر پیوست شده تصاویر پیوست شده
    فایل های پیوست شده فایل های پیوست شده

    2 تشکر توسط:


  4. Top | #3
    کاربر سایت

    تاریخ عضویت
    Dec 2013
    ورژن ویبولتین
    4.2.1
    نوشته ها
    436
    مورد پسند
    415 بار
    نوشته های وبلاگ
    2
    اطلاعات
    Windows 7/Server 2008 R2 Firefox 30.0
    میزان امتیاز
    55

    پیش فرض

    این هک دقیقا چکار می کنه؟ لینک ها به چه شکل میشوند؟

اطلاعات موضوع

کاربرانی که در حال مشاهده این موضوع هستند

در حال حاضر 1 کاربر در حال مشاهده این موضوع است. (0 کاربران و 1 مهمان ها)

موضوعات مشابه

  1. قرار دادن Custom Search گوگل در سایت
    توسط VBIran در انجمن آموزش های وی بولتین
    پاسخ: 54
    آخرين نوشته: 2015/11/29, 10:14 PM
  2. دانلود هک Friendlier URLs
    توسط Mystogan در انجمن هک 4.1.x
    پاسخ: 2
    آخرين نوشته: 2012/02/07, 05:45 PM
  3. نمایش google custom search در صفحه جدید؟
    توسط mahdizd در انجمن پرسش و پاسخ
    پاسخ: 0
    آخرين نوشته: 2012/01/11, 02:00 PM
  4. سوال در رابطه با custom bb code
    توسط lvlehrad در انجمن پرسش و پاسخ
    پاسخ: 3
    آخرين نوشته: 2011/11/02, 01:32 AM
  5. درخواست هک Use Google Custom Search In Navbar - Step By Step
    توسط Coderx در انجمن درخواست از vBulletin.org
    پاسخ: 3
    آخرين نوشته: 2011/10/16, 09:02 PM

کلمات کلیدی این موضوع

علاقه مندی ها (Bookmarks)

علاقه مندی ها (Bookmarks)

مجوز های ارسال و ویرایش

  • شما نمیتوانید موضوع جدیدی ارسال کنید
  • شما امکان ارسال پاسخ را ندارید
  • شما نمیتوانید فایل پیوست کنید.
  • شما نمیتوانید پست های خود را ویرایش کنید
  •