Results 1 to 9 of 9

Thread: htaccess to change subdomain to subfolder?

  1. #1

    Join Date
    Jan 2008
    Location
    UK
    Posts
    62
    Rep Power
    0

    htaccess to change subdomain to subfolder?

    We currently have a subdomain of forum.website.com -> "htdocs/vbb/".

    What we're considering doing (for a couple of reasons) is getting rid of the subdomain approach and accessing our forum by "www.website.com/forum/".

    So:-
    1) Can we get the virtual folder "forum" to infact use "vbb". ie: So "www.website.com/forum/" actually looks (behind the scenes) at "www.website.com/vbb/".
    2) Redirect all "forum.website.com" traffice to "www.website.com/forum" along with all values after the URL? eg: So forum.website.com/forum.pl?x=y -> www.website.com/forum.pl?x=y

    We're slightly concerned how existing cookies will behave, but we can try it ourselves by just implementing (1) above first.

    Thanks

  2. #2

    Join Date
    Feb 2009
    Location
    India
    Posts
    174
    Rep Power
    9
    1. Yes you can contact support and ask them to create a symbolic link forum pointing to htdocs/vbb .
    2. i am not sure about it may be search and replace in database(after making a backup)

  3. #3

    Join Date
    Jan 2008
    Location
    UK
    Posts
    62
    Rep Power
    0
    Quote Originally Posted by shrupa View Post
    1. Yes you can contact support and ask them to create a symbolic link forum pointing to htdocs/vbb .
    2. i am not sure about it may be search and replace in database(after making a backup)
    1) Thanks, I'll ask them.
    2) Would surely be an .htaccess entry? ie: To change any request for forum.website.com to instead be www.website.com/forum?

  4. #4

    Join Date
    Feb 2009
    Location
    India
    Posts
    174
    Rep Power
    9
    i think .htaccess wont replace links with in forum... I just did a quick search and found this.. https://www.phpbb.com/community/view...f=46&t=1296695 ... I am not am expert in phpbb so ready carefully and verify it. If u found a way to do it please share it

  5. #5
    Mod.. with bite.. Croc Hunter's Avatar
    Join Date
    Sep 2002
    Location
    Australia
    Posts
    7,333
    Rep Power
    27
    You can do 1) and 2) in OPS or with .htaccess but you must change the path in your phpBB admin panel first. If you are not sure how to do it I suggest you create a duplicate forum in /htdocs/forum then swing it over.
    Croc Hunter MSC :

  6. #6

    Join Date
    Jan 2008
    Location
    UK
    Posts
    62
    Rep Power
    0
    Quote Originally Posted by Croc Hunter View Post
    You can do 1) and 2) in OPS or with .htaccess but you must change the path in your phpBB admin panel first. If you are not sure how to do it I suggest you create a duplicate forum in /htdocs/forum then swing it over.
    Are you able to show the .htaccess syntax to (invisibly) remap a folder to another (including all of the URL etc) after it?

    eg: So "www.mysite.com/folder1/code.pl?x=y" infact accesses "/htdocs/folder2/"?

    The user will see "www.mysite.com/folder1/blob.pl?x=y" as their URL, but behind the scenes (via htaccess) it's hitting another folder?

    We've tried doing it in htaccess, but failed as the URL was rewritten in the browser, which we do not want.

  7. #7

    Join Date
    Feb 2009
    Location
    India
    Posts
    174
    Rep Power
    9
    Yep. Even i was unable to figure out .htaccess method.. Did you read the link given by me?

  8. #8
    PowWeb Staff
    Join Date
    Jun 2012
    Location
    Phoenix
    Posts
    122
    Rep Power
    6
    If your main site is pointing to /htdocs/ you can see about renaming the folder the forum is located in to /htdocs/forum/ so the main site is up and the forum can be accessed at /forum/. It is important to note that if you have any manually saved forum links in your database, or site url saved in the database, that you will have to manual update these. You can use File Manager to rename the folder. Just double click the name of the folder and it will let you type in a new one and save.
    If you do rename the folder to /forum/ I would highly recommend making a redirect in the .htaccess that if someone types in the old forum.website.com it redirects to website.com/forum/ instead of giving an error. (Or you can update the subdomain pointer in Domain Central for the same reason.)
    Melissa
    Technical Support

  9. #9
    Mod.. with bite.. Croc Hunter's Avatar
    Join Date
    Sep 2002
    Location
    Australia
    Posts
    7,333
    Rep Power
    27
    It's to much to post here, would be faster to just do it myself, and I can but it would cost you. PM me if you want it done. It's much like Melissa said but again I advise to change the install directory in the phpBB admin panel first. This saves alot of manual database path fixes later. You also need to consider any mods, themes, templates and hard coded files installed. Then finally a 301 .htaccess redirect for any old links to the new url.
    Croc Hunter MSC :

Posting Permissions

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