subdomain problem
4 posts
• Page 1 of 1
subdomain problem
Hi.
I got a problem to rewrite my subdomain.
I got a site www.mydomain.com and I already did the following rule :
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} !^www.mydomain.com
RewriteCond %{HTTP_HOST} ^([^.]+).mydomain.com
RewriteRule ^$ /dev/index.php?sd=%1 [NC]
This rule is redirecting all subdomain "mysub.mydomain.com" to "/dev/index.php?sd=mysub" execepted for the sub "www."
This works fine.
But, I got a problem to add a new var in the url.
I would like to do the following :
"http://mysub.mydomain.com/mypage/" to "/dev/index.php?sd=mysub&page=mypage".
I tested different things with no success.
Can you help ?
Thanks
I got a problem to rewrite my subdomain.
I got a site www.mydomain.com and I already did the following rule :
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} !^www.mydomain.com
RewriteCond %{HTTP_HOST} ^([^.]+).mydomain.com
RewriteRule ^$ /dev/index.php?sd=%1 [NC]
This rule is redirecting all subdomain "mysub.mydomain.com" to "/dev/index.php?sd=mysub" execepted for the sub "www."
This works fine.
But, I got a problem to add a new var in the url.
I would like to do the following :
"http://mysub.mydomain.com/mypage/" to "/dev/index.php?sd=mysub&page=mypage".
I tested different things with no success.
Can you help ?
Thanks
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: subdomain problem
Hello,
Lets try adding the following rule to the existing:
Regards
Andrew
Lets try adding the following rule to the existing:
- Code: Select all
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.mydomain\.com
RewriteCond %{HTTP_HOST} ^([^.]+).mydomain\.com
RewriteCond %{REQUEST_URI} !-f
RewriteCond %{REQUEST_URI} !-d
RewriteRule ^([^/]+)/?$ /dev/index.php?sd=%1&page=$1 [NC]
Regards
Andrew
Re: subdomain problem
Hi Andrew!
That's brillant! This is working perfectly! You are my superman!!
Thanks a lot.
Cheers,
Yull
That's brillant! This is working perfectly! You are my superman!!
Thanks a lot.
Cheers,
Yull
Re: subdomain problem
Hi Andrew Again! Sorry to bugger you.
I got a prob. I have now to add a new parameter to my url rewrite:
RewriteCond %{HTTP_HOST} !^www\.mydomain\.com
RewriteCond %{HTTP_HOST} ^([^.]+).mydomain\.com
RewriteCond %{REQUEST_URI} !-f
RewriteCond %{REQUEST_URI} !-d
RewriteRule ^([^/]+)/?$ /dev/index.php?sd=%1&page=$1 [NC]
I want to add &mypg=... like this
RewriteRule ^([^/]+)/?$/...mynewparam.../ /dev/index.php?sd=%1&pg=$1&mypg=$2 [NC]
Thanks in advance.
Cheers,
Yull
I got a prob. I have now to add a new parameter to my url rewrite:
RewriteCond %{HTTP_HOST} !^www\.mydomain\.com
RewriteCond %{HTTP_HOST} ^([^.]+).mydomain\.com
RewriteCond %{REQUEST_URI} !-f
RewriteCond %{REQUEST_URI} !-d
RewriteRule ^([^/]+)/?$ /dev/index.php?sd=%1&page=$1 [NC]
I want to add &mypg=... like this
RewriteRule ^([^/]+)/?$/...mynewparam.../ /dev/index.php?sd=%1&pg=$1&mypg=$2 [NC]
Thanks in advance.
Cheers,
Yull
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 16 guests