Help with redirecting css from subdomain to domain, styling missing on page

Hi

I am new to web design and am now looking after a small website for a club. I have created a subdomain to be used for testing new ideas and have copied over Wordpress and the SQL database. Everything works fine except that the subdomain site has no styling, all the pictures are not showing and the formatting has disappeared.

I have searched through several forums and think I need to put coding in the .htaccess file that will redirect the css to the main domain instead of the subdomain. However I cannot find an example of this code to amend. Can anybody help with the coding I need?

The subdomain is www.support.rdmac.org.uk

Thanks for any help.

Hi

I am new to web design and am now looking after a small website for a club. I have created a subdomain to be used for testing new ideas and have copied over Wordpress and the SQL database. Everything works fine except that the subdomain site has no styling, all the pictures are not showing and the formatting has disappeared.

I have searched through several forums and think I need to put coding in the .htaccess file that will redirect the css to the main domain instead of the subdomain. Is this correct or is there some other error in the css? Can anybody help?

The subdomain is www.support.rdmac.org.uk

Thanks for any help.

The path to style.css sheet file is incorrect and giving a 404 error:

// support site
http://www.support.rdmac.org.uk/wp-content/themes/twentyten/style.css

// Main site
http://www.rdmac.org.uk/wp-content/themes/twentyten/style.css

Also check other included files, search for .support in the source code.

http://www.support.rdmac.org.uk/wp-content/themes/twentyten/style.css
Gives a 404 - Not Found

Is it so large a file it would be a problem?
Don’t you think it would be better for 2 sites to NOT share the same CSS file?

Edit:

cross threads merged

I have updated the .htaccess file in my subdomain folder and it now looks like:

RewriteEngine on
RewriteRule ^themes/twentyten/style.css$ http://www.rdmac.org.uk/wp-content/themes/twentyten/style.css [R,L]

I also have a .htaccess file in my main domain folder. Should I have 2 .htaccess files or will there be conflict between the two? This new coding in my .htaccess file does not correct my problem. Can anyone help?

Have I now got this thread in the correct forum?

Thanks

Try copying the file from your // Main site
http://www.rdmac.org.uk/wp-content/t…yten/style.css

to // support site
http://www.support.rdmac.org.uk/wp-c…yten/style.css

The biggest benefit is having two different style-sheets for testing new ideas”.

I do not see any advantage of trying to use the .htaccess file.

Hi.

The problem is that if I have separate style sheets, one for the main site and one for the subdomain, the browser cannot find the style sheets for the subdomain for some reason and I end up with a subdomain page with no styling. The only way round it is if I use .htaccess unless I can find another easier way.

Any ideas on this are welcome

The CSS file is missing.

Try opening your main site then with your cursor anywhere on the main screen, right-click and select View-Source from the drop-down menu.

Search for .css, select the complete path and click. The CSS source file will open in a new window.

Try the same with the support subdomain site and you will find that a “404 file not found error” appears.

Same for:
http://www.support.rdmac.org.uk/wp-content/plugins/wp-easy-gallery-pro/css/prettyPhoto.css?ver=3.1.2
and
http://www.support.rdmac.org.uk/wp-content/plugins/wp-easy-gallery-pro/css/default.css?ver=3.1.2

Hi

The file is there on the server but for some reason the browsers cannot link to it. Its the same problem with all the browsers Ive tried. I think it has something to do with the fact im using a subdomain.

At present Im trying to redirect it to the main domain to get round this problem.

Thanks

Try moving the style.css file up to route:
http://www.support.rdmac.org.uk/style.css

If that works then move the next level down:
http://www.support.rdmac.org.uk/wp-content/style.css

If that works then move the next level down:
http://www.support.rdmac.org.uk/wp-content/themes/style.css

If that works then move the next level down:
http://www.support.rdmac.org.uk/wp-content/themes/twentyten/style.css

Have you checked your paths for spaces and also the URLs, paths and filenames are ALL case-sensitive.

Also try the subdomain path without www

Hi.

Thanks for you advice. Unfortunately the code that looks for the CSS files is generated by Wordpress so I cannot change the file paths without using something like a command in .htaccess. I’m looking for a way to change the paths to the .CSS files without changing the paths to other areas in my support site.

If I copy the support page to my PC and change the link path to the CSS file from <href="www.support.rdmac.org.uk/... to <href="www.rdmac.org.uk/... the page seems to render properly.

Perhaps moving this thread to the WordPress forum where someone may have experience installing WP in a subdomain might be more helpful.

In any case, this doesn’t seem to be a CSS issue.