![]() |
|
#1
|
|||
|
|||
Help pleaseHello all - anyone help please?
~~~~~~~~~~~~~~~~~ Can anyone rewite this for me to tidy it up/correctly write it but also to include the ability to work with or without www. as it currently only works without. ~~~~~~~~~ RewriteEngine On RewriteCond %{HTTP_HOST} ^([^.]+)\.example\.com$ [NC] RewriteCond %1 !^www$ [NC] RewriteRule ^.*$ /%1\.php [R,QSA] ~~~~~~~~~ Thank you. |
|
#2
|
||||
|
||||
|
You should start out by specifying what you are trying to accomplish.
|
|
#3
|
|||
|
|||
Help needed pleaseQuote:
Can anyone help me sort the following out please. I am trying to accomplish the opening of a php file that corresponds to the same name as "subdomain" name. E.G if this is called: mysub.domain.com then the .htaccess file would open this file » mysub.php ( located in the same folder as the .htaccess file ) I currently have this working but only with non www. input & I need to have it working for both www. & non.www usage. I adapted something from what I saw elsewhere so it will also need correcting if anyone can help. I have *Wildcards enabled but do not have httpd conf access. ~~~~~~~~~~~~~~~ RewriteEngine On RewriteCond %{HTTP_HOST} ^([^.]+)\.example\.com$ [NC] RewriteCond %1 !^www$ [NC] RewriteRule ^.*$ /%1\.php [R,QSA] ~~~~~~~~~~~~~~~ I would also appreciate the call for the final file being by way of 301 Permanent Redirect if that is also possible................thanks. |
|
#4
|
|||
|
|||
thanks but.......dosent seem to work......it pulls index.php if you use www. or if you don't use www. - Is it just possible to adapt the one I supplied to include www. usage as at least I know that that does work at least with non www. usage?
Thanks |
|
#5
|
||||
|
||||
|
Quote:
I would recommend redirecting the www requests to the non-www address. So, www.subdomain.example.com would be redirected to subdomain.example.com |
|
#6
|
|||
|
|||
ok thanksthanks....thats not so bad as the final php file that gets pulled will contain a final redirect anyway.........how can I implement what you say inside the .htaccess file? I need to get as much done inside that file for 301 reasons, also can you advise on the final 301 transition to the final php file?
Thanks again |
Recent GIDBlog
A Week in Kuwait by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The