1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Re-write rules .htaccess - any one experience with it [help]

Discussion in 'Off Topic' started by KatieH, Jul 19, 2013.

Thread Status:
Not open for further replies.
  1. KatieH

    KatieH Member

    Hi, I don't have much knowledge with .htaccess file and re-write rules and 2 days ago after we launched our beta project public http://www.nihonomaru.com/ we ran into an issue where the rules conflicts with my forum folders and my images on my forum were down.

    The dev I work with tried something and fixed it but i am not sure if these rules are written correctly. He is using cake framework. http://book.cakephp.org/2.0/en/installation/url-rewriting.html

    If someone is experience, do you see any issue with these rules?

    <IfModule mod_rewrite.c>
    RewriteEngine on

    RewriteCond %{REQUEST_URI} !^/forum/(.*)
    RewriteCond %{REQUEST_URI} !^/cache/(.*)
    RewriteCond %{REQUEST_URI} !^/cache/(.*)

    RewriteCond %{REQUEST_URI} !^/chan/(.*)
    RewriteCond %{REQUEST_URI} !^forum\.nihonomaru\.com

    RewriteCond %{HTTP_HOST} ^(www\.)?nihonomaru.com$
    RewriteRule ^$ app/webroot/ [L]
    RewriteCond %{HTTP_HOST} ^(www\.)?nihonomaru.com$
    RewriteRule (.*) app/webroot/$1 [L]

    #RewriteRule ^$ app/webroot/ [L]
    #RewriteRule (.*) app/webroot/$1 [L]

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php [QSA,L]
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Need example of URL that is broken by your rules.
  3. KatieH

    KatieH Member

    It broke my forum img1 directly like this url would give me 500 error note http://img1.nihonomaru.com/forum/images/nihonomaru/statusicon/forum_new.gif So the dev changed the rules to these ones in my original post ^ and both my forum and homepage do work now. He is gone for 2 weeks away.

    But the next day i started seeing all sort of weird bugs, like not able to login on the homepage and some profiles gets broken, not sure if is it a bug and we will need to fix it or it is caused because these rules were written in a bad way. That is basically the summary of this situation. So i wan to make sure the structure of these rules are written correctly right ? That the dev did, was that he made the .htaccess ignore my forum urls so it doesn't get broken, which is what he did.
    Last edited: Jul 20, 2013
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Got a link showing the problem? Are there any specific errors?
  5. KatieH

    KatieH Member

    Hi Jake, i actually find an issue. My gallery which is a completely different script is getting blocked by these .htaccess rules http://www.nihonomaru.com/chan/ so what can i do to these rules to allow my gallery to be viewable again. I guess we need to find a way so my gallery can't be blocked by the homepage script.

    The other issue about the login and profile getting broken, it is code related, i think the dev when he is back, can fix these, they seem to be broken features when he migrated the beta and put it live.
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  7. KatieH

    KatieH Member

    Hi Jake, i didn't buy a Xenforo yet and never used one.
  8. KatieH

    KatieH Member

    Hi, is anyone knowledgeable with re-write rules and .htaccess?
  9. Brogan

    Brogan XenForo Moderator Staff Member

    If you need support with your installation, post on the support forums of the software you use.
Thread Status:
Not open for further replies.

Share This Page