.htacces rewrite to subdomains without wildcard dns - .htaccess

I've googled around quite a bit and also tried some of the solutions I've found. Unfortunately without success. My problem: For a Wordpress install I couldn't do a subdomain setup since I couldn't activate wildcard DNS on my server. This made me set up my Wordpress network install on the main domain and on two subdirectories as below:
domain.be
domain.be/alpha
domain.be/beta
I can however make set subdomains on my server, so I set up the following:
alpha.domain.be
beta.domain.be
I'm now trying to use .htaccess to rewrite this, so that people who go to domain.be/alpha are automatically redirected to alpha.domain.be - and obviously the same for the second (beta) subdirectory. As far as I can see, I should be able to pull this off without using dns wildcards. Unfortunately, I'm too inexperienced with .htaccess rules to pull this off. Anyone out there who can help me with this?
If you have your doubts about this set-up, I'm also interested in hearing about it.

Yeah, it's not gonna work. Mostly becasue the subfolder address is hardcoded in the blog address.
two things you can try:
make manual subdomains and pint the docroot for it at the wordpress install
use the domain mapping plugin to map subdomains to the subfolders. still gotta add each subdomain as a server alias to the same folder as wordpress.

Related

Valet not working on kali linux. Redirecting to htdocs

I installed valet on Kali Linux, and pinged a test domain to make sure it's working which it is. However, after running valet park in the folder directory that I have my files. It redirects me to xampp dashboard whenever I access the route on the browser. I know very well to type the folder name followed by a .test domain. I've tried almost everything online. I see this is a popular issues and I've gone through every possible solution I see online. It's still not working, I tried to rename the index.php file in the htdocs folder which gets render automatically whenever you access the htdocs folder, now it only list the folder structure for me as a result. I tried to move the project out of htdocs still not working. I stopped apache and tried accessing it again but unfortunately I got, "This site cant be reached"
No response.. Well fortunately i was able to fix it, not sure it's the best way. But hopefully this might help someone, i configured ssl on the domain with valet using valet secure foo.bar and it automatically redirect to https. That way, i was able to escape from xampp

Redirect issue with cake php and html folder

I have a website in cake php host on a domain root(www.example.com/) directory it work fine. Now the issue is i placed a html template on www.exapmle.com/html but when i open this in browser it rdirect to website means www.example.com and seen cake php website.
One thing that is asked quite a lot on #cakephp is how to use other apps alongside CakePHP, and the answer giving is normally pretty ugly. Stick the files/folders in side webroot/. Although that does work, its not very nice. So ill show you a little trick with .htaccess files.
The first (really simple way) is to use a .htaccess inside the sub folder. For example you can have a copy of Joomla! running alongside cake with no issues when you have the .htaccess for Joomla! enabled. If the app does not have one and/or you would not know what to put in the .htaccess file you have another option
Make Apache stop processing rewrites if it finds a request for your sub directory. This is done by adding a rule for the sub directory and then telling Apache it is the last rule to process. The .htaccess file you want to edit is the one found inside your APP directory. All you want to add is the following line:
You can do this for as many sub folders as you wish, by changing the regex accordingly. Its pretty simple to do and a much cleaner way than having all your stuff inside the webroot/ folder of your APP.
Source : http://goo.gl/kOEZ9Y

Domains & Subdirectories

I set up a WordPress installation for a friend under a subdirectory on my site. I have set up his domain name to point to the subdirectory of the installation (and I have his domain name registered under my GoDaddy account). I can't figure out how to configure my GoDaddy account or the WordPress installation to use his domain name for all his webpage's addresses.
For example, I want his website to display myfriendssite.com/about.php instead of mysite.com/friendswordpress/about.php
I have tried editing the .htaccess files for both my main sites directory and my friend's directory to no avail (I don't know what I'm doing). Please help!
Assuming you are using Apache, you should configure a virtual host with the myfriendssite.com and point it to the correct directory.
Because you haven't provided any example of the config code, I cannot give you specific example but please read through the apache doc for virtual host and you should find what you need. Here's the link
If you can post some sample of the relevant apache config, or specifics like sample domain and directories, I can help you more with a config example.

.htaccess not working with .cfm pages on Railo

I want to do some very basic .htaccess stuff like block a directory by IP address. I know why this problem is happening, I just don't know how to fix it. I've read every post I can and there doesn't seem to be a consensus on how to fix it. Railo/Tomcat is grabbing control of the page before .htaccess rules are applied.
I am running Centos with Railo / Tomcat / Apache. I believe I am using mod_cfml, at least that's what's under the connector folder.
I have tried putting my .htaccess files in httpd.conf without any luck. I'm not sure I was doing that correctly, but I dropped the code into the virtual domain section of the site I'm working on.
Has anyone got this to work properly?
On iis you can change the order modules run which would solve that issue Asbyou would tell the htaccess module to run before mod_cfml
Can you do that on Apache?

installing umbraco on a subdomain that is a subfolder of the root

I have a similar problem as here Umbraco (4.7) in a subfolder or virtual directory? but not exactly.
I have an umbraco installation running as a subdomain (newmain.mydomain.com). The way we are doing subdomains on my server is to create an application under the main site then let the web.config at the root take care of the url rewriting. This is working fine for all my other subdomains, but umbraco doesn't seem to like it at all. Can someone point me in the right direction in the umbraco web.config (or elsewhere) to help me make this work? Perhaps I need better rewriting on the web.config at the root, but I'm unsure what changes to make.
I'm reluctant to create another root level website for various reasons.
I ended up moving this to a more standard style subdomain. I think it's disappointing that it must be configured this way.

Resources