Hi does anyone know how to redirect from a subdirectory or sub-folder to root directory?...without it affecting dolphin ie uploads etc.
I have my site in a sub directory ie http://www.mysite.com/folder
and id like it to show http://www.mysite.com
Hi does anyone know how to redirect from a subdirectory or sub-folder to root directory?...without it affecting dolphin ie uploads etc. I have my site in a sub directory ie http://www.mysite.com/folder and id like it to show http://www.mysite.com |
Hi Kosmic!
I'm not sure if I understand the situation correctly. So, your script is installed in a subdirectory.. right?.. Now, you want it to show as you root directory.. example: when someone types http://www.mysite.com, you want the script index page to appear?
If that's the case, you'll need to redirect your index page (in the root directory) to your script location.. example: redirect mysite.com to mysite.com/folder.
If I misunderstood, please tell us more about what exactly that you need done.
Hope this helps. |
Kosmic, |
Kosmic,
I wouldnt manusally put a command.. I would just do the redirect on cpanel like I said above.. Just redirect index (in the public_html) to the folder where the script is sitting.
"..If that's the case, you'll need to redirect your index page (in the root directory) to your script location.. example: redirect mysite.com to mysite.com/folder.." |
kosmic, may i ask why you dont just move the install to root? a 301 may (may) deter your site from being indexed by the search engines. later, DosDawg When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support |
I already have setup in the control panel a redirect from www.mysite.com to www.mysite.com/folder, reason being its on hostmonster ( in incubation ) and there are other sites setup on the server so it keeps it tidy. I was thinking of using a htaccess file to rewrite it so it removes the folder from being viewed. Fussy i know but i like things tidyish. is this achievable with htaccess?....or will it conflict? |
you really dont even have to do that in .htaccess but it is something you can do, and that is what the redirect in cpanel should do for you. you can write a simple redirect script set it as html and point it to the subdirectory that you are wanting to serve. <meta create a blank .html file, add this to the head of that file it will send your guests who call up http://yourdomain.com to http://yourdomain.com/subdirectory. now if you are not happy with that, you can in htaccess write a rewriterule that will then in turn take http://yourdomain.com/subdirectory and serve it as being http://yourdomain.com/ hope that loop makes sense to you. later, When a GIG is not enough --> Terabyte Dolphin Technical Support - Server Management and Support |
my site already redirects from www.mysite.com to www.mysite.com/subfolder... this was setup ages ago on cpanel. what i need is to hide the /subfolder without moving the whole site to root. For example..... this is what im trying to achieve (but obvs not drupal) i have already tried implimenting various htaccess methods to no avail, if you have read through the link you'l notice they mention shortening the site url in (drupal) settings.php to just the main domain name....which the equivilent to us should be in header.inc.php i have also amended this and that didnt work as all the rewrite rules for dolphin in my installation folder htaccess wont work (unless as a guess i manually go through them and add in the subfolder name) So basically ive followed that guide (and a few others lol) and changed it to suit my needs, drank several coffee's inbetween and am back to square 1. hmmmm so am i wasting my time?....should i leave it be for now?.. as everything would be resolved when i move it to vps. |
my site already redirects from www.mysite.com to www.mysite.com/subfolder... this was setup ages ago on cpanel.
what i need is to hide the /subfolder without moving the whole site to root.
For example..... this is what im trying to achieve (but obvs not drupal)
i have already tried implimenting various htaccess methods to no avail, if you have read through the link you'l notice they mention shortening the site url in (drupal) settings.php to just the main domain name....which the equivilent to us should be in header.inc.php i have also amended this and that didnt work as all the rewrite rules for dolphin in my installation folder htaccess wont work (unless as a guess i manually go through them and add in the subfolder name)
So basically ive followed that guide (and a few others lol) and changed it to suit my needs, drank several coffee's inbetween and am back to square 1.
hmmmm so am i wasting my time?....should i leave it be for now?.. as everything would be resolved when i move it to vps.
Kosmic, it looks like what you need is a clean url. Here's another thought, why not create a subdomain (the subdirectory where the script is installed) and redirect to the root directory applying clean url. Here's something that might be worth looking at to help you achieve this:
http://www.bluehostforum.com/archive/index.php/t-288.html
|
By the way, that thread discusses solutions to redirect parked domains but it should also be ok for subdomains on the same server.
Cheers. |
I have made the following changes in .htaccess file (in public_html directory): RewriteEngine on RewriteCond %{HTTP_HOST} ^(www.)?yourdomain.com$ RewriteCond %{REQUEST_URI} !^/subfolder/ RewriteRule ^(.*)$ /subfolder/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d Now it's redirect me and not showing the subfolder just www.yourdomain.com. The only problem is I have no idea how to configure header.inc.php in site address and admin path! Anybody got ideas? Hope this will work for all of you when we get proper path ;) |
Did you try |
I have made the following changes in .htaccess file (in public_html directory): RewriteEngine on Now it's redirect me and not showing the subfolder just www.yourdomain.com. The only problem is I have no idea how to configure header.inc.php in site address and admin path! Anybody got ideas? Hope this will work for all of you when we get proper path ;) If your trying to achive the same thing iwas a while ago my blog post at boonexnerd.com might help. |
I have made the following changes in .htaccess file (in public_html directory): RewriteEngine on Now it's redirect me and not showing the subfolder just www.yourdomain.com. The only problem is I have no idea how to configure header.inc.php in site address and admin path! Anybody got ideas? Hope this will work for all of you when we get proper path ;) If your trying to achive the same thing iwas a while ago my blog post at boonexnerd.com might help. Looking really great I will give a try, thank you kosmic! ;) |