Creating a Subfolder for mobile project - .htaccess

I have a website www.mysite.com. I created a mobile site for the same which is mobile.mysite.com.
Now the problem is I want to move the mobile and make it accessible via www.mysite.com/m/.
I am working in Codeigniter framework. If I have to do it so, then what things should I take care of? Any suggestions will be helpful.

For this you need to create a sub-domain of your site www.mysite.com and name it as "m". Shift all the folders and files of your mobile site into "m". Now www.mysite.com/m would be accessible.
*Note: Don't crate sub folder in your main site.it wont work.you have to make sub-domain.

Related

Install WordPress on a add on domain in Hetzner hosting

I am new to Hetzner so I am sorry if my question doesn't make sense.
Long story short, this is my situation:
I have 2 WordPress Websites and each of them is hosted in a different hosting, from a different hosting provider (not Hetzner).
My goal is to host both of my WordPress Websites in one account on Hetzner (one hosting).
I asked this question before and I got told that I should buy Web Hosting Level 9 package, so that I can add both of my sites as add on domains and that they can be literally 2 different WordPress Websites but they would have the same hosting (site1.com and site2.com , but same host).
And I did just that. I purchased Web Hosting Level 9 package and during the purchasing process I had to claim a free domain. I did that and used "aisolutionmontenegro.com" , but I don't plan on don't anything with this particular domain.
Now after that I added the domain my first WordPress Website as a add on domain, and it showed up.
The problem that I am facing is that I want to install WordPress to this first add on domain, but I can not see the option "WordPress" on the Services part, like I see it when I am on the main domain that I claimed for free "aisolutionmontenegro.com".
The domain I claimed for free
Remember, I don't need aisolutionmontenegro.com at all, I just want to add two add on domains and on each of them install WordPress. Is that possible and how?
The domain of my site
Thank you in advance!
I found out what the problem was.
When I added the "main" domain with I claimed for free while buying Web Host Level 9 package from Hetzner, I had to go to "Products" and then select the "main" domain.
After I selected the main domain, in the left side menu, go to Services and you can see there WordPress. We click WordPress and then go to the installation process.
During the installation process you have to choose a root directory for your site, and here is where you need to be careful.
If you want to install your WordPress site on an add on domain (let's assume its called "site1.com") then you need for the root directory to create a new folder called the name of your site (in this case create a folder "site1").
After that you can continue with the installation process normally.
And for every add on domain that we want to install WordPress on we do the same thing, we click on the "main" domain, and then we click WordPress. During the installation process as the root directory we create a new folder called like the add on domain (for example our second add on domain is called "site2.com", we create a folder called "site2").

One website, two diffrent domains with one subfolder, possible?

I would like to put a website on two domains like the following:
www.abc.com/xyz
and
www.xyz.com
I don't want to do redirect. Is this possible? I am using IIS.
Thanks.
yes, possible... you need 2 separate websites and you need to setup a virtual folder on the first one (abv.com/xyz) pointing to the folder of xyz.com

Dynamic .htaccess subdomain security

I have yet another .htaccess question, simple for you, not so much for me.
Let's say my main site is found at http://domain.com. I do all of my pre-release testing at sandbox.domain.com and sandbox.domain.co. I just realized that Google has gone ahead and indexed my sandbox sites... Ugggh!
The document root folder on my Apache server with the live site is always called ALIVE, and in order to make my sandbox contents live I quickly rename the folders, ie ALIVE->OLDx, SANDBOX->ALIVE.
My goal is to prevent indexers and users from accessing my sandbox pages. I am trying to design a .htaccess file for document root that only allows my ip address when accessed from a sandbox subdomain (sandbox.domain.com), otherwise it allows everyone when accessed from the main domain (domain.com). This would eliminate the process of remembering to update the .htaccess file each time I release a new site.
This doesn't seem too difficult, but I haven't been able to find the right combination. Any pointers in the right direction will be much appreciated!
Create a .htaccess inside each folder (like sandbox):
order deny,allow
deny from all
allow from YOUR IP HERE

Setting up domain names locally for testing?

I will be using one hosting account with several domains parked on it along with a main domain name. I need to be able to show different content based on what domain is being accessed. So, my question is, how can I test this locally?
I have Vista
I use XAMPP
Any help with this would be greatly appreciated?
You can define multiple domains in your hosts file.
you can find it C:\Windows\System32\drivers\etc
There are examples written there to help you understand, how it works. then create a page lets say index.php and parse the domain there and redirect it to relevant domain.

Restricting access to files within a folder to webservice IIS6/7

I am looking for a way to restrict direct access to a certain folder or folders on our website which is hosted in IIS7 in our second dev environment, IIS6 in our first dev environment and IIS6 on production.
Basically we should be able to link to these files from our website i.e.:
http://www.domain.com/stuff/survey.pdf
But if someone tries to link to this from a blog post, etc. it should not serve the content. Is there any way to do this in a web config or is that beyond the abilities of IIS?
What I ended up doing was writing a PHP script which served content from outside of the web root, but only if the user was logged in and had a valid site cookie.
Then I created folders to replace all the content we were currently serving (.pdf, .png, etc.) since there was not that much that we wanted secured. I name the folder the same as the original document, i.e.: /webroot/survey.pdf/ and then placed the index.php inside of the survey.pdf folder.
This worked, and now we can use the script to link to content that we want secured.

Resources