Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Regular Coder
    Join Date
    Sep 2002
    Posts
    459
    Thanks
    0
    Thanked 20 Times in 20 Posts

    2 pathway questions

    1. On one of our sites if you type:
    http://www.example.com/wp
    or
    http://www.example.com/wp/
    (replacing example.com with our own)
    You get an "Error establishing a database connection" page which we don't have that page for 1 and for 2 we don't use word press anymore. So why do we get this display page?

    2. On the site I'm working on now I modified the error pages to return to the main index page of the website. The problem is that with normal file paths the templat comes out fine, however if you entered a path like:
    http://www.example.com/wp/
    with a trailing slash it interfers with the css link causing the page to display without any style. When viewing the source all coding is un affected. How do I check for and remove/ adjust the trailing slash so the page will display correctly?

    Note in the 2 examples path above /wp returns page with style link correct /wp/ returns without styling but link is unaffected.

    Thanks In Advance!

    Edit:
    Used rtrim() to remove trailing slash and while it did remove it results remain the same. Maybe the 'REQUEST_URI' is taking command of path? Can it do that?
    Last edited by c1lonewolf; 01-17-2014 at 07:39 PM.
    NO Limits!! DHCreationStation.com
    ------------------------------------------------------------
    Broken items wanted for tinkerin'! PostItNow@BrokenEquipment.com
    Global Complaint Dept.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Trailing slashes will not control anything directory wise; this sounds like you are using mod rewrite rules. Otherwise, both wp and wp/ will end up either serving wp/index or a directory listing. REQUEST_URI is simply what is provided to PHP by the server, and if I'm not mistaken is actually the path and script requested.

    If you have a rewrite rule, simply adding a /? to the rule will allow a trailing slash, and if you match a pattern then exclude that from the capture. Also, if you are using rewrite, you should stop relying on rewrite and add it only after everything is functional.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #3
    Regular Coder
    Join Date
    Sep 2002
    Posts
    459
    Thanks
    0
    Thanked 20 Times in 20 Posts
    I don't use any mod rewrite that I know of unless it's a cpanel thing. I try not to mess with the htaccess when it comes to pathways.

    http://www.e-bam.net/wp
    http://www.e-bam.net/wp/
    either way there is no file or directory so it should produce the same error. Right?

    The htaccess has 'RewriteEngine on' but I figure that's for cpanel to update addons and such...
    Last edited by c1lonewolf; 01-17-2014 at 08:13 PM.
    NO Limits!! DHCreationStation.com
    ------------------------------------------------------------
    Broken items wanted for tinkerin'! PostItNow@BrokenEquipment.com
    Global Complaint Dept.

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Both of these are serving /wp/index.php then. So the only thing making the difference is the use of the request_uri.
    Not sure why you really need it then, if you're not using mod rewrite, you already know where you are so request uri will simply return this file.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #5
    Regular Coder
    Join Date
    Sep 2002
    Posts
    459
    Thanks
    0
    Thanked 20 Times in 20 Posts
    Ok so I'm bumping this patway thing again.
    Having the same problem...I can reroute all error pages to a single script and send basic info through the query to the main index.ph which would process. But I need this for a network setup.

    Our host states that it's an html dev problem and changed the css link to be an absolute path. But I can't use that! They don't want to believe that it's a server thing, when it is!

    Should I just stay with sending to a different script and then sending the basics back to main index page. Or should I hound them until they find and fix the issue?
    hehehe

    @Lu
    I'm no longer using request_uri...now when htaccess send errorpage to index it retrieves the redirect status from the server request to post the correct error. By sending the redirect to the main index I could retrieve all the info that would normally be gathered in regular error pages, but never leaving the site!hehehe
    Last edited by c1lonewolf; 01-27-2014 at 07:39 PM.
    NO Limits!! DHCreationStation.com
    ------------------------------------------------------------
    Broken items wanted for tinkerin'! PostItNow@BrokenEquipment.com
    Global Complaint Dept.

  • #6
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    I don't understand, is this talking about a css problem now? Using an absolute path is as simple as /path/to/css; you don't need to use the domain name within it as its implied.
    Rewrite rules can apply to any filetype as well, so there could be an issue there.

    Given a relatively recent post of yours indicating that the host was blocking code input from forms, I question the overall validity of the hosting company. Perhaps you should look for a new host?
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #7
    Regular Coder
    Join Date
    Sep 2002
    Posts
    459
    Thanks
    0
    Thanked 20 Times in 20 Posts
    naw! I don't speak with them that often, I think I just do things they don't expect! hehehe

    Anyway their answer was:
    I'm afraid if is not possible to get stylesheet link to work with both types of urls on a shared server.
    That's all they had to say to begin with, instead of blaming everything on lil' ol' me. hehehe

    Isn't there a way to load stylesheets using a php script like I do with our image hosting viewer script?
    I mean instead of the path being:
    themes/mytheme/style.css
    couldn't it be:
    theme.php
    Last edited by c1lonewolf; 01-28-2014 at 07:35 AM.
    NO Limits!! DHCreationStation.com
    ------------------------------------------------------------
    Broken items wanted for tinkerin'! PostItNow@BrokenEquipment.com
    Global Complaint Dept.

  • #8
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    Theoretically, but if you can load a .php file you should be able to load a .css file. There's no relevance to this being a shared server unless you're piggybacking another domain name.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #9
    Regular Coder
    Join Date
    Sep 2002
    Posts
    459
    Thanks
    0
    Thanked 20 Times in 20 Posts
    well the site I'm testing it on is an addon domain so it's also listed as a subdomain of the original. Is that what you mean by "piggybacking another domain"?

    It's still has it's own domain name and access as an addon, but in cpanel it's also posted to be a subdomain.
    NO Limits!! DHCreationStation.com
    ------------------------------------------------------------
    Broken items wanted for tinkerin'! PostItNow@BrokenEquipment.com
    Global Complaint Dept.

  • #10
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    A subdomain shouldn't make a difference.
    I mean piggybacking off of something like http://someoneelses.com/~mydir where mydir is now your place. If you do that, then your HTML will be disrupted. I think you can use a base tag for that.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #11
    Regular Coder
    Join Date
    Sep 2002
    Posts
    459
    Thanks
    0
    Thanked 20 Times in 20 Posts
    nope, not piggybacking! I've decided in order to keep forward progress though I'd just go back to using an error handling file then send the error number in a query string to the main index page. seems less of a headache for now.
    All while still wondering why it does that. heheh Thanks for the help though Lu. I'm thinking it might be a subdomain thing, but have no way to test on main domain right now.
    If anyone figures out an answer please let me know.Thanks
    NO Limits!! DHCreationStation.com
    ------------------------------------------------------------
    Broken items wanted for tinkerin'! PostItNow@BrokenEquipment.com
    Global Complaint Dept.

  • #12
    Regular Coder
    Join Date
    Sep 2002
    Posts
    459
    Thanks
    0
    Thanked 20 Times in 20 Posts
    I believe this may be a browser problem but I'm not sure.
    I tested on index.php using our main domain and a parked
    domain.
    http://www.e-bam.net
    http://www.brokenequipment.com-parked domain

    I linked to themes relatively and using the absolute http path.
    1. e-nam.net should show green background color, waterdrops background image and black text.
    2. brokenequipment.com should show black bgcolor with star field background and gray text.

    Neither worked until I used rewrite conditions in my htaccess file:
    RewriteCond %{HTTP_REFERER} !^http://www.e-bam.net/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.e-bam.net$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.brokenequipment.com/.*$ [NC]
    RewriteCond %{HTTP_REFERER} !^http://www.brokenequipment.com$ [NC]


    and php cache control headers in the document.
    but it's still buggy can any test and find fixes

    Note: changing hosts is currently not an option...I don't make the rules the boss does. hehehe
    NO Limits!! DHCreationStation.com
    ------------------------------------------------------------
    Broken items wanted for tinkerin'! PostItNow@BrokenEquipment.com
    Global Complaint Dept.

  • #13
    Regular Coder
    Join Date
    Sep 2002
    Posts
    459
    Thanks
    0
    Thanked 20 Times in 20 Posts
    Ok folks I need something simple there's to many options online that I don't have time to understand.

    1. Need site to update style sheets and images depending
    on webaddress.

    2. Uses login codes so I have the following headers:

    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
    header("Cache-Control: private no-cache");


    3. Placed the following in htaccess file:

    ### Apply a Cache-Control header to index.php
    <Files index.php>
    Header append Cache-Control "public, must-revalidate"
    </Files>


    And was going to implement meta tags which most say don't work anyway. Help! This is very important!
    I need this simplified please?
    NO Limits!! DHCreationStation.com
    ------------------------------------------------------------
    Broken items wanted for tinkerin'! PostItNow@BrokenEquipment.com
    Global Complaint Dept.

  • #14
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    This still doesn't make any sense
    There is no relationship between http://site1.com and http://site2.com. If both use identical HTML and serve /mycss.css as the stylesheet than there is no relationship between /mycss.css for either site. Site1 and Site2 can have any css code they want and it won't interact with the *other* domain. So #1 means nothing since that's the default behaviour of HTML.

    I'm still trying to figure out where the PHP is fitting into this at all.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #15
    Regular Coder
    Join Date
    Sep 2002
    Posts
    459
    Thanks
    0
    Thanked 20 Times in 20 Posts
    1. All of our domains are passed to a single file index.php
    We have 1 main domain and the rest are parked domains.
    2. The theme style is added according to which domain is currently being accessed. So domain1 has one display and domain 2 has another.

    Until now, I couldn't get the themes to change accordingly. And if the theme did change it would not load the background images for it. Seems now it works. However, I don't know if it was a specific code I just added or a combination of codes that is allowing it to work. All themes come from same directory so changing from one domain name to another should not cause problems since all are in the same place, access the same file etc..

    dir structure:
    themes
    theme1
    theme2

    domain1 > theme1
    domian2 > theme2

    Our template system works great! But if we wanted to adjust themes it didn't. It couldn't cache the current theme in case it changes...can't really explain it better than that.

    Basically you don't get what I'm saying and I don't understand what you're sayin' I guess.

    either way to get the backgrounds to show in my browsers, I have to reload the page after intial access.
    Last edited by c1lonewolf; 02-06-2014 at 07:45 PM.
    NO Limits!! DHCreationStation.com
    ------------------------------------------------------------
    Broken items wanted for tinkerin'! PostItNow@BrokenEquipment.com
    Global Complaint Dept.


  •  
    Page 1 of 2 12 LastLast

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •