Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mod_rewrite, URL and subdomain

Status
Not open for further replies.

barcin

Programmer
Jan 3, 2006
1
PL
Hi!!

I was searching answer for ma question everywhere but I couldn't find it, so please HELP ME.

I have a hosted server. I have one main domain. There is some website under this domain. i'm using mod_rewrite to have SEO URL's so insted domain.com/index.php?section=5 I have domain.com/site/1. All mod_rewrite rules are in .htaccess file.

Using cPanel I've created subdomain sub.domain.com. There is a different website under this domain, but i want to have also SEO URL's, (sub.domain.com/site/2 goes to sub.domain.com/section.php?section=2) so I added this code to .htaccess file in main directory:

Code:

RewriteCond %{HTTP_HOST} !^ RewriteCond %{HTTP_HOST} ^(.*)sub\.domain\.com$
RewriteRule ^site/([0-9]+)$ [L]



but this code doesn't work. Please help me, what's wrong whith this code?

Thanks in advance,

Barcin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top