phpBeginner06 Posted February 16, 2007 Share Posted February 16, 2007 Is there a way to mask a url, for a specific subdirectory, in php; without using mod_rewrite in my htaccess file? Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted February 16, 2007 Share Posted February 16, 2007 I would have to say yes, I do think it's possible. Whatever path you choose has to point to a valid script and within that script you can just use $_SERVER['REQUEST_URI'] to get the full requested URI. You'd end up with URLs that look like this though: http://domain/some/path/script.php/param1/param2/param3 I've never tried it so I could be wrong though. (EDIT) NM. The server will just think script.php is a directory and give you a 404. You'd need to use something like http://domain/some/path/script.php?param1/param2/param3 Quote Link to comment Share on other sites More sharing options...
phpBeginner06 Posted February 16, 2007 Author Share Posted February 16, 2007 roopurt18, that would work; but what I am trying to do is hide the query sting and just be able to set a url of my choice to display in the address bar; no matter what page someone goes to. I read a little bit about mod_rewrite, but I am not sure if my web host allows their server to have the htaccess file changed. I know that it does not show up any where in my file manager and so far, I have not found a way to view it. Plus I want to do this for one sub-directory only and the rest of my sub-directories would follow the nomal domain path hierarchy. what I would like to do is to be able to have something like this: http://www.somedomain.com too replace this type of query string that is attached to root domain path http://www.somedomain.com/index.php?pgnum=27 I do not know if there is a way to do this just with PHP Script by itself; that is what I am wondering. Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted February 16, 2007 Share Posted February 16, 2007 Well, the .htaccess file will only show up in your file manager if it exists. Try creating one and running some initial tests. Quote Link to comment Share on other sites More sharing options...
phpBeginner06 Posted February 16, 2007 Author Share Posted February 16, 2007 Are some files not hidden from public view in a file manager. I think I tried to create a .htaccess file one time and tried to upload it; but my file manger said that this type of file was not allowed. I even typed the file name just like this ".htaccess"; that was the right way, isn't it? Even if I could create,upload,modify this type of file; will that not change all of my sub-directory files? I do not want all of my sub-directories pages to be masked; I only want one. I just hope I can find a way to do this with a php script and maybe use an include in all of the pages in my sub-directory, that I want the domain masked. Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted February 16, 2007 Share Posted February 16, 2007 Try e-mailing the support department of your host? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.