Forum Moderators: phranque
Belated new year wishes!
I have some files in my main domain the url like http://maindomain.com/products/product1/*.html and also *.pdf, Now i have subdomain url like http://subdomain.com/products/product1/*.html same files which is in main domain.
Here i want to redirect the main domain /product1/ to subdomain for *.html files only and not *.pdf.
Please help me on this using .htaccess file. This is very urgent.
[edited by: jdMorgan at 2:23 am (utc) on Jan. 8, 2004]
[edit reason] de-linked [/edit]
Welcome to WebmasterWorld [webmasterworld.com]!
You can use Apache mod_rewrite, and add a RewriteCond to your RewriteRules, specifying that only .html files are to be redirected:
RewriteCond {REQUEST_URI} \.html$
RewriteCond {REQUEST_URI} !\.pdf$
Jim
We will be happy to help you debug your code if you wish to post it, but as our charter [webmasterworld.com] says, our purpose is to help you learn to write your own code, and not to write your code for you.
The reference I posted above, the Apache mod_rewrite documentation [httpd.apache.org], and the Apache URL Rewriting Guide [httpd.apache.org] are good places to learn how to do what you need to do.
Also, a WebmasterWorld site search [google.com] for related terms will turn up many threads on this subject.
Jim