Jump to content

Recommended Posts

For some reason, $1 is always blank. (Wildcards are on, and all that)

 

RewriteCond %{HTTP_HOST} ^pages\.domain\.com [NC]
RewriteRule (.*?) pages/$1 [L]

 

The main page shows up, but things like http://pages.domain.com/style/style.css does not load. What could be wrong with the code?

 

Wes

Link to comment
https://forums.phpfreaks.com/topic/168036-solved-subdomain-directory-problem/
Share on other sites

Make css and images ...everything thats included, a full url http://site.com/style.css

 

Ok. That's what I normally do when building a site from scratch, I don't know why I didn't think of doing that with this WP :P

 

Thanks I'll give it a shot

Or you could do this:

 

RewriteCond %{REQUEST_FILENAME} !-f

 

The above rewritecondition basically checks to see whether the url being requested is a physical file or not (style.css). If it is a physical file, it will not apply the rule. If not, it will.

 

Worked like a charm! Thanks to both of you

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.