|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
hello
not sure which forum i should be asking this in but i need to figure out a way to create shortcuts on my server to particular addresses. for example i will have something at.. http://www.mysite.com/projects/projectone/index.php but i want it to show up at... http://www.mysite.com/projectone/index.php now i know i could create a page index.php at... http://www.mysite.com/projects/index.php which could refer to the correct address but that will still show the real address or of course i could have a frame which would mask the real address but i was wondering is there another way to do this perhaps via the .htaccess file??? thanks in advance gar |
|
#2
|
|||
|
|||
|
It has nothing to do with DNS; it's Apache... You should search for internal redirect under user "freebsd" in Apache section, he has answered it so many times..
|
|
#3
|
|||
|
|||
|
hi
ok from what i understood this is all apache stuff which i not alone dont understand but can't touch on my server due to the fact its a rented space. this is starting to get annoying now cos two weeks ago i needed to modify the php .ini and of course i'm not allowed do that ether. so at the risk of turning this into another question does anyone know of any hosts where you can rent space and you do have access to these types of files, or does that not exist?? a+ gar |
|
#4
|
|||
|
|||
|
of course this is possible. it just depends on how much you want to pay.
you can even rent a server where you have administrator / root login ![]() this question should go to the "web-hosting" forum, but sorry, i will not follow you there (i boycott this forum due to the advertising there.) but i think this has been offered already there. another approach to your shortcut-problem: unix supports filesystem-based shortcuts: Code:
/www/www.mysite.com/# ln -s projects/projectone . you can also create them from php script if you donīt have shell access
__________________
-- Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more. |
|
#5
|
|||
|
|||
|
>you can also create them from php script if you donīt have shell access
i dont!! is this under the filesystem functions i can do this?? what do i need to look for in the manual to do this?? thanks gar |
|
#6
|
|||
|
|||
|
http://www.php.net/manual/en/function.symlink.php
you probably need to login via ftp before, chmod the parent directory to 777 and after this you should chmod back to 755 (!) |
|
#7
|
|||
|
|||
|
mmm the explanation there is a bit on the minimal so i'm a bit vague about what exactly this does and how it works, at the moment i'm searching devshe for any other threads on "symlink" to see if i can get a clearer idea of what this does, if you know of any threads, tutorials etc i would appreciate the urls.
sorry for being so dim but this is the first time i've ever done something with the filesyatem in php!! a+ gar |
|
#8
|
|||
|
|||
|
you probably wonīt find much info on devshed about symlinks. they are a basic unix filesystem thing.
similar to links in windows ("shortcut"), but they work better. a link to a directory is treated as directory. so: PHP Code:
should do the job. as told earlier, login via ftp before and after to set the permissions! |
|
#9
|
|||
|
|||
|
i dont follow, i have very limited knowledge of windows systems and just begining to understand unix systems.
in your code... chdir("/www/..../www.yourhost.de"); i understand whats going on with a chdir() but the url you use has me confused - "/www/..../www.yourhost.de", ok i understand that "www.yourhost.de" should be replaced with my site url but why the "/www/...." before it? and why use the url when thats not the real address of my site which is more like "/home/sites/site170/users/garrett/web/collective" i did a test like so.. $dir = getcwd(); chdir("$dir/projects"); $dir = getcwd(); echo $dir; and i understand whats happening there, ie the current directory is changed for one beyond at "/projects" but after that i'm lost and cant figure out how to use this? what does the symlink actually create, a file? does this only last for the duration of this script? if*(symlink("projects/projectone","./projectone"))*{ echo*"Symlink created."; }*else*{ echo*"Symlink not created."; } thanks in advance gar |
|
#10
|
|||
|
|||
|
you should replace the path with the path to your www root. if you use a relative path, the script must be in the root.
the symlink actually is a special file. it is like a text file that only contains the name of the other file. not really, but think of it like that. and it lasts until deleted. and it shows up in your ftp-client. additionally to this, apache needs to be setup to follow sym-links, sorry, forgot this. you need to ask your provider for this if it is not already activated. if you have htaccess configuration access, you probably can activate it yourself. |
![]() |
| Viewing: Dev Shed Forums > System Administration > DNS > shortcuts? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|