Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Search engine friendly URL's breaks Extension manager

edited March 2010 in Vanilla 1.0 Help
I've been trying to figure out why the AJAX doesn't work in the Extension manager to enable/disable extensions. The page being loaded is /settings/?PostBackAction=Extensions. I noticed it's loading (or trying to load) js/ajax.js, etc. however /settings/js doesn't exist. /settings.php?PostBackAction=Extensions works fine. Can anyone confirm that this is happening to them too?

Comments

  • edited March 2010
    oops...

    In .htaccess replace:
    # Prevent some little bad effects of Friendly Urls on relative links in some
    # extensions
    RewriteRule ^(discussions|categories|search|post|settings|people|[0-9]+)/(extensions|themes|images|ajax)/(.*) $2/$3 [QSA,L]
    RewriteRule ^(discussions|categories|search|post|settings|people|[0-9]+)/(account.php|categories.php|comments.php|extension.php|index.php|people.php|post.php|search.php|settings.php) $2 [QSA,L]
    RewriteRule ^discussion/([0-9]+/){1,2}[^/]*/(extensions|themes|images|ajax)/(.*) $2/$3 [QSA,L]
    RewriteRule ^discussion/([0-9]+/){1,2}[^/]*/(account.php|categories.php|comments.php|extension.php|index.php|people.php|post.php|search.php|settings.php) $2 [QSA,L]
    RewriteRule ^(discussions|account|search|post|[0-9]+)/.+/(extensions|themes|images|ajax)/(.*) $2/$3 [QSA,L]
    RewriteRule ^(discussions|account|search|post|[0-9]+)/.+/(account.php|categories.php|comments.php|extension.php|index.php|people.php|post.php|search.php|settings.php) $2 [QSA,L]
    by:
    # Prevent some little bad effects of Friendly Urls on relative links in some
    # extensions
    RewriteRule ^(discussions|categories|search|post|settings|people|[0-9]+)/(extensions|themes|images|ajax|js)/(.*) $2/$3 [QSA,L]
    RewriteRule ^(discussions|categories|search|post|settings|people|[0-9]+)/(account.php|categories.php|comments.php|extension.php|index.php|people.php|post.php|search.php|settings.php) $2 [QSA,L]
    RewriteRule ^discussion/([0-9]+/){1,2}[^/]*/(extensions|themes|images|ajax|js)/(.*) $2/$3 [QSA,L]
    RewriteRule ^discussion/([0-9]+/){1,2}[^/]*/(account.php|categories.php|comments.php|extension.php|index.php|people.php|post.php|search.php|settings.php) $2 [QSA,L]
    RewriteRule ^(discussions|account|search|post|[0-9]+)/.+/(extensions|themes|images|ajax|js)/(.*) $2/$3 [QSA,L]
    RewriteRule ^(discussions|account|search|post|[0-9]+)/.+/(account.php|categories.php|comments.php|extension.php|index.php|people.php|post.php|search.php|settings.php) $2 [QSA,L]
  • Excellent. Thanks.
  • edited July 2006
    Another problem - it doesn't seem to work here: http://support.vanillahost.com/discussion/1/testing/ javascript url: http://support.vanillahost.com/discussion/1/testing/js/ajax.js (the "big input" doesn't work, just refreshes). Though it's working on this forum? Hmm...
  • edited July 2006
    I replaced (extensions|themes|images|ajax) by (extensions|themes|images|ajax|js) on line 3 and 7 but forgot on line 5. You need to add "|js" (I just edited my previous post, it should work fine now).

    On this forum, the link might be "/community/js/ajax.js" and not "js/ajax.js"
  • I'm still having problems with your new rules. Here's my entire .htaccess, copied to htaccess.txt: www.vanillahost.com/vanilla/htaccess.txt
  • edited March 2010
    It must be a problem with the rules line 16.

    Changing the order of the rules should solve this problem. Put
    RewriteRule ^discussion/([0-9]+/){1,2}[^/]*/(extensions|themes|images|ajax|js)/(.*) $2/$3 [QSA,L]
    RewriteRule ^discussion/([0-9]+/){1,2}[^/]*/(account.php|categories.php|comments.php|extension.php|index.php|people.php|post.php|search.php|settings.php) $2 [QSA,L]
    before the line 16.
  • Thanks, that works ... Another problem, when signing up it links to the terms (from /people/?PostBackAction=ApplyForm) but it gives a 404 (/people/termsofservice.php).
  • There three rules with "(account.php|categories.php|comments.php|extension.php|index.php|people.php|post.php|search.php|settings.php)" you can add "|termsofservice.php"
  • edited March 2010
    .htaccess should look like that:
    RewriteEngine On
    Options +FollowSymLinks -Multiviews

    #Discussions
    RewriteRule ^discussions$ index.php [QSA,L]
    RewriteRule ^discussions/$ index.php [QSA,L]
    RewriteRule ^discussions/([0-9]+)$ index.php?page=$1 [QSA,L]
    RewriteRule ^discussions/([0-9]+)/$ index.php?page=$1 [QSA,L]
    RewriteRule ^([0-9]+)$ index.php?CategoryID=$1 [QSA,L]
    RewriteRule ^([0-9]+)/$ index.php?CategoryID=$1 [QSA,L]
    RewriteRule ^([0-9]+)/([0-9]+)$ index.php?CategoryID=$1&page=$2 [QSA,L]
    RewriteRule ^([0-9]+)/([0-9]+)/$ index.php?CategoryID=$1&page=$2 [QSA,L]

    #Comments
    RewriteRule ^discussion/([0-9]+/){1,2}[^/]*/(extensions|themes|images|ajax|js)/(.*) $2/$3 [QSA,L]
    RewriteRule ^discussion/([0-9]+/){1,2}[^/]*/(account.php|categories.php|comments.php|extension.php|index.php|people.php|post.php|search.php|settings.php|termsofservice.php) $2 [QSA,L]

    RewriteRule ^discussion/([0-9]+)/([0-9]+)/(.+)$ comments.php?DiscussionID=$1&page=$2 [QSA,L]
    RewriteRule ^discussion/([0-9]+)/([0-9]+)/(.+)/$ comments.php?DiscussionID=$1&page=$2 [QSA,L]
    RewriteRule ^discussion/([0-9]+)/(.*)$ comments.php?DiscussionID=$1 [QSA,L]
    RewriteRule ^discussion/([0-9]+)/(.*)/$ comments.php?DiscussionID=$1 [QSA,L]
    RewriteRule ^discussion/([0-9]+)/([0-9]+)$ comments.php?DiscussionID=$1&page=$2 [QSA,L]
    RewriteRule ^discussion/([0-9]+)/([0-9]+)/$ comments.php?DiscussionID=$1&page=$2 [QSA,L]
    RewriteRule ^discussion/([0-9]+)$ comments.php?DiscussionID=$1 [QSA,L]
    RewriteRule ^discussion/([0-9]+)/$ comments.php?DiscussionID=$1 [QSA,L]

    #Categories
    RewriteRule ^categories/$ categories.php [QSA,L]

    #Account
    RewriteRule ^account/$ account.php [QSA,L]
    RewriteRule ^account/([0-9]+)$ account.php?u=$1 [QSA,L]
    RewriteRule ^account/([0-9]+)/$ account.php?u=$1 [QSA,L]

    #Search
    RewriteRule ^search/$ search.php [QSA,L]
    RewriteRule ^search/([0-9]+)$ search.php?page=$1 [QSA,L]
    RewriteRule ^search/([0-9]+)/$ search.php?page=$1 [QSA,L]
    RewriteRule ^search/saved/([0-9]+)$ search.php?SearchID=$1 [QSA,L]
    RewriteRule ^search/saved/([0-9]+)/$ search.php?SearchID=$1 [QSA,L]
    RewriteRule ^search/saved/([0-9]+)/([0-9]+)$ search.php?SearchID=$1&page=$2 [QSA,L]
    RewriteRule ^search/saved/([0-9]+)/([0-9]+)/$ search.php?SearchID=$1&page=$2 [QSA,L]

    #Post
    RewriteRule ^post/$ post.php [QSA,L]
    RewriteRule ^post/([0-9]+)$ post.php?CommentID=$1 [QSA,L]
    RewriteRule ^post/([0-9]+)/$ post.php?CommentID=$1 [QSA,L]
    RewriteRule ^post/category/([0-9]+)$ post.php?CategoryID=$1 [QSA,L]
    RewriteRule ^post/category/([0-9]+)/$ post.php?CategoryID=$1 [QSA,L]

    #Settings
    RewriteRule ^settings/$ settings.php [QSA,L]

    #People
    RewriteRule ^people/$ people.php [QSA,L]

    #extension
    RewriteRule ^extension/$ extension.php [QSA,L]

    #Poll extension
    RewriteRule ^extension/([0-9]+)/$ extension.php?DiscussionID=$1 [QSA,L]
    RewriteRule ^discussion/$ comments.php [QSA,L]


    # Prevent some little bad effects of Friendly Urls on relative links in some
    # extensions
    RewriteRule ^(discussions|categories|search|post|settings|people|extension|page|[0-9]+)/(extensions|themes|images|ajax|js)/(.*) $2/$3 [QSA,L]
    RewriteRule ^(discussions|categories|search|post|settings|people|extension|page|[0-9]+)/(account.php|categories.php|comments.php|extension.php|index.php|people.php|post.php|search.php|settings.php|termsofservice.php) $2 [QSA,L]
    RewriteRule ^(discussions|account|search|post|page|[0-9]+)/.+/(extensions|themes|images|ajax|js)/(.*) $2/$3 [QSA,L]
    RewriteRule ^(discussions|account|search|post|page|[0-9]+)/.+/(account.php|categories.php|comments.php|extension.php|index.php|people.php|post.php|search.php|settings.php|termsofservice.php) $2 [QSA,L]

    #Pages
    RewriteRule ^page/(.*)$ index.php?Page=$1 [QSA,L]
    Edited: should fix problems with the poll extension.
    Edited: fix problems with number as a title.
  • It seems to be working again...Dinoboff, you are again my head.
  • Are these posted rules newer than the ones in the Friendly URLs add-on? I'm struggling to get Polls to work.
  • scubaguyscubaguy New
    edited March 2008
    it fixes one problem with Polls, but you still can't edit a Poll. Spode came up with a solution here http://lussumo.com/community/?CommentID=81287
  • Would anyone care to offer a fix for the blog extension? http://domain.com/extension/category/1/?PostBackAction=Blog is the URL, but it throws a 404 error with friendly URLs turned on Is anybody still active on this forum? I know I'm not, but I am creating some new forums and hope to use Vanilla as it's the easiest to set up, the most secure (or maybe that's due to it being OBscure), and the friendliest to learn. I've just started trying to use friendly URLs as the latest forum is intended for mass public audience, so it needs to be SEF.
  • PlayGod - not the answer you're looking for, but BlogThis works with Friendly URLs fine. I vaguely recall I adjusted the rewrite rules to work - the same rules may well work with Blog.
  • There appears to be extra stuff in the URL--

    Just a guess, but what happens when you take it out, like this: http://domain.com/extension/?PostBackAction=Blog
  • After editing my forum's .htaccess per this extension's readme I can't access my forum. All I get is a white web page. no matter if I go to
    ../foro
    ../foro/
    ../foro/index.php
    ../foro/index.php/

    Any ideas how to go back to an original working .htaccess for the forum's root folder?
    What are the default Vanilla 1 .htaccess files?
  • By default, there is no .htaccess
Sign In or Register to comment.