domain.com/folder/XX.html to XX.domain.com

Using a single web hosting account to host multiple sites

domain.com/folder/XX.html to XX.domain.com

Postby codelol » Fri Feb 23, 2007 7:53 pm

Hi all
this is my first help..

I have this code for rewrite anypage.php to anypage.html :

Code: Select all
RewriteEngine on
RewriteRule ^([^-]+).html$ searchResult.php?q=$1 [L]

I can put the subdomain with the name of the page?
example:

domain.com/folder/XX.html
to
XX.domain.com/

thanks to help me :wink:
Last edited by codelol on Sat Feb 24, 2007 3:09 pm, edited 2 times in total.
codelol
 
Posts: 2
Joined: Fri Feb 23, 2007 7:32 pm

Postby richardk » Sat Feb 24, 2007 11:13 am

I have this code for rewrite anypage.php to anypage.html :

That mod_rewrite rewrites /anypage.html to /searchResult.php?q=anypage. If you really are getting /anypage.html to anypage.php it's probably MultiViews (mod_negotiation).

So so you want people who go to domain.com/folder/xx.html redirected to xx.domain.com/folder/xx.html (where there's a real (.php?) file).

Or do you want xx.domain.com/folder/xx.html rewritten to domain.com/folder/xx.html. If you want it rewritten, do you have DNS for the sub domains? What directory on the server are you sent to when you go to a sub domain at the moment?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby codelol » Sat Feb 24, 2007 2:54 pm

richardk wrote:
Or do you want domain.com/folder/xx.html rewritten to xx.domain.com If you want it rewritten, do you have DNS for the sub domains? What directory on the server are you sent to when you go to a sub domain at the moment?



Yes I want this.
I have DNS for subdomains to /httpdocs/

visit this example of structure of the links :
Code: Select all
http://www.qarchive.org/


thanks
codelol
 
Posts: 2
Joined: Fri Feb 23, 2007 7:32 pm

Postby richardk » Sun Feb 25, 2007 10:27 am

It's not quote if you change it.

I still don't fully understand. You want xx.domain.com to be in the address bar of the user's browser but you want to send the domain.com/folder/xx.html file? In a .htaccess file in your document root
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.domain\.com$ [NC]
RewriteRule ^$ /folder/%2.html [L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 20 guests

cron