Member Avatar for Pityu

Hey there

My issue is the following:
I have a windows-based xampp-apache server with which I would like to make sub-sub domain redirects to subdirectory:

I have a domain, for which on the cpanel I've made an A-record to my IP address:
The sub domain is *.dev.bestudion.net.

Whay I want to have is:
the ability to redirect to the sites on the developin side like:
to the help-me.com site which is under development to be able to acces through this link:
help-me.com.dev.bestudion.net.

the subdirectory where it stands is: <root> /dev/help-me.com

I have almost done the script, just the last time what I made, did an infinite loop of redirects:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.dev\.bestudion\.net
RewriteCond %{HTTP_HOST} ([^.]+)\.dev\.bestudion\.net [NC]
RewriteRule ^(.*)$ http://%1.dev.bestudion.net/dev/%1 [L,R]

I've made a code, which works with linux based apache, but not windows:

RewriteEngine On
RewriteCond %{HTTP_HOST} ([-_a-z0-9.]+)\.dev\.bestudion\.net
RewriteRule ^(.*)$ /dev/%1/$1 [L]

Anybody, an idea?

Member Avatar for diafol

//EDIT sorry reread your question and I misinterpreted.

wondering whether you were using Apache or IIS (just saw the xampp bit).

Member Avatar for Pityu

//EDIT sorry reread your question and I misinterpreted.

wondering whether you were using Apache or IIS (just saw the xampp bit).

Apache with XAMPP

me too need to know how to do like this trike to allow me add it to my site Click Here

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.