SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: rewrite rule

  1. #1
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    rewrite rule

    Guys,

    Asking for your help:

    I want to write a htaccess rewrite rule that will redirect all urls :

    accounts.mysubdomain.com/TB/apps/.... -->
    accounts.mysubdomain.com/apps/

    can you please help me out?

    TIA

  2. #2
    Non-Member
    Join Date
    Dec 2011
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Put the following code into your .htaccess and check if it is working.

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^accounts\.mysubdomain\.com$
    RewriteRule ^TB/apps/(.*)$ http://accounts.mysubdomain.com/apps/ [R=permanent,L]

  3. #3
    SitePoint Member
    Join Date
    Jun 2010
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll try. thanks!

  4. #4
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,650
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    stormy,

    What about the No Case flag on the {HTTP_HOST} variable and telling elad that there is no need for an external redirection (http://%{HTTP_HOST}), only the redirection to the apps directory?

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •