Subfolder As Index

SpaceshipSpaceship
SpaceshipSpaceship
SpaceshipSpaceship
Watch

Maverick

Established Member
Impact
21
I've recently installed a script on one of my sites but the script needed to be installed in a subfolder and the file in the subfolder is a .pl file. So to use the script you have to go at this address (ie http://www.sitename.com/folder/test.pl) but I'd like it to be view at http://www.sitename.com. How can I make this possible? Can I do it by using htaccess redirect?

TIA for any help/guidance. :)
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Make a index.php
<?
include("folder/test.pl");
?>

I am no good at PHP but I believe that this should work.
 
0
Close
I got a parse error when I tried to use the code you provided. :S
 
0
Close
As long as you use any redirect from the main index - it shouldn't really matter ... I use my main index on many sites as only a way to sort different languages - The only problem you may have is that the main folder where your content is Will possibly have more PR and links etc ... later on , so remember to show this if you ever decide to sell it.

Place the following code between your HEAD tags.

Code:
<SCRIPT LANGUAGE="JavaScript">

window.location="http://www.yourdomain.com/";

</script>
 
Last edited:
0
Close
1
Close
cvxes said:
.htaccess

redirect /index.php http://www.domain.com/subdir


Then, make an index.php. Empty, nothing in it...
Thanks cvxes. That one did the trick. :)

And thanks to all who responded and gave their help. :)
 
0
Close
Methods for redirecting:
1. Apache .htaccess (as written before)
2. header() in index.php
3. meta refresh tag in index.html
4. JavaScript in index.html (as written before)
5. include() in index.php (kinda awkward)
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back