?
Solved

basic domain .htaccess redirection

Posted on 2007-09-30
4
Medium Priority
?
261 Views
Last Modified: 2012-05-05
Hi

I am in a shared hosting server

/public_html/ ( root for www.domain.com)
/publc_html/a/ (root for www.domainA.com)
/public_html/b/ (root for www.domainB.com)
.....etc
total 50 domains

-------------------------------------------------------------------------------
I edit /public_html/.htaccess

RewriteCond %{HTTP_HOST} ^(www\.)?domaina\.com [NC]
RewriteRule ^(.*)$ http://www.sedoparking.com/domaina.com [R=302,L]

RewriteCond %{HTTP_HOST} ^(www\.)?domainb\.com [NC]
RewriteRule ^(.*)$ http://www.sedoparking.com/domainb.com [R=302,L]

......... etc

My question:
So is it I have to do these 2 lines for 50 times (for 50 domains)...
Is there better way of doing this?
minimize my works?
I am willing to clarify my question...
Thanks













0
Comment
Question by:LearningLearning
  • 3
4 Comments
 
LVL 43

Accepted Solution

by:
ravenpl earned 2000 total points
ID: 19987791
RewriteCond %{HTTP_HOST} ^(www\.)?domain(.)\.com [NC]
RewriteRule ^(.*)$ http://www.sedoparking.com/domain%1.com [R=302,L]
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 19987799
But You my also match against the directory(one letter exactly?)

RewriteCond ^(.)/.* http://www.sedoparking.com/domain$1.com [R=302,L]
0
 

Author Comment

by:LearningLearning
ID: 19988376
actually all the domains are different name.
So is it I have to add 50 * 2 lines in the .htaccess?
or there are 2 lines codes that will make the job easier?
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 19989023
> actually all the domains are different name.
I understand they are totally different like domaina.com nextdomain.com thirddomain.com ?
Maybe then subfolders(You said they're a/ b/ c/) have something in common with redirection URL?

If nothing in common, You need those 50(*2) entries...
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question