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.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Mar 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Another mod_rewrite issue

    http://www.explicitgamer.com/dev/art...-xiii-review-2 (rewritten URL)
    http://www.explicitgamer.com/dev/article.php?p=4668 (actual URL)

    Mod Rewrite Rules:
    Code:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /dev/article/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /dev/article.php [L]
    </IfModule>
    I use the following code in article.php to figure out what article is being pulled:
    Code:
    $uri = str_replace("/", "", substr($_SERVER["REQUEST_URI"], 13));
    $xg_article = getAllArticleInfoByName($uri);
    And if it matters, pages are cached, but that shouldn't matter because both the actual and rewritten urls are cached (separately).

    If you goto the actual url the share tools (digg, reddit, facebook, twitter etc) work fine.

    If you use the rewritten url none of them work. For some reason they aren't able to connect to the page properly to grab info (or verify the page even exists) through the rewritten url.

    I'm not really sure what is wrong, but it is kind of irritating that I can't figure out a solution. I'm not too familiar with mod_rewrite so I was hoping someone could help me fix it or direct me to some resources that might be able to help me out.

    Thanx in advance,
    Commander

    To expand on the problem a bit:

    The problem is that the rewritten URL doesn't work outside of the website. Like if you goto the rewritten URL itself, it works fine, but if you try to submit the URL to something like DIGG, Facebook, or Reddit, their scripts can't find the url so the webpage can't be submitted.

    http://digg.com/submit/

    If you go there, and type in http://www.explicitgamer.com/dev/art...-xiii-review-2 as the article url, it gives an error:

    This link does not appear to be a working link. Please check the URL and try again.

    The only thing I can think of is that the mod_rewrite that I currently have setup is actually doing a redirect, not a rewrite. That is the only reason that I can think of that this would be happening.
    Last edited by XGCommander; 03-28-2010 at 02:58 PM. Reason: Expanded explaination a bit


 

Posting Permissions

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