MyBB Community Forums

Full Version: Strange URL extension
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello there, I'll warn you I don't know too much about html and stuff. I recently started with MyBB and have installed a few themes on my forum. The url is completely fine if I just type it in or directly go to it. However, when I change themes via the quick theme select, this occurs:

http://example.com/index.php?my_post_key...eme=number

Now, I had this problem before when the index page showed up with the extension index.php and deleting the index.html file from my root solved that. So I figure it's probably the same problem. I went back and deleted the index.html files from the cache folder and the various theme folders and renamed them so they weren't theme2, theme3, theme4, etc. However, the extension remains.

I thought about reuploading the themes, but wouldn't that just cause the same problem again? Since the cache files didn't appear until I uploaded the themes, so there's no way to prevent this ahead of time.
The URL indeed shouldn't contain this data after switching - I've opened an issue for this: https://github.com/mybb/mybb/issues/2618

You should leave/restore the index.html files as they prevent directory listings from being displayed in case the server configuration doesn't cover that (which is considered a vulnerability). Likewise the cache/ structure is handled by MyBB and will be regenerated.
Quote:Now, I had this problem before when the index page showed up with the extension index.php and deleting the index.html file from my root solved that

That is not what would have solved index.php being in the URL, index.php would be in the URL because that's the name of the file.

Quote:I went back and deleted the index.html files from the cache folder and the various theme folders and renamed them so they weren't theme2, theme3, theme4, etc

You can't just rename these folders, because then the themes would break.

If I'm understanding correctly (and I'm not sure I am), do you want to remove index.php from the URL? You can redirect away from it, but it's doing no harm being in the URL, it's simply the name of the file.

I'd also strongly advise not randomly deleting and renaming things without understanding what you're actually doing as you'll end up causing yourself more problems.
(2017-01-13, 07:03 PM)Devilshakerz Wrote: [ -> ]The URL indeed shouldn't contain this data after switching - I've opened an issue for this: https://github.com/mybb/mybb/issues/2618
Thank you for that. Smile Hopefully this will get resolved.

(2017-01-13, 07:03 PM)Devilshakerz Wrote: [ -> ]You should leave/restore the index.html files as they prevent directory listings from being displayed in case the server configuration doesn't cover that (which is considered a vulnerability). Likewise the cache/ structure is handled by MyBB and will be regenerated.
(2017-01-13, 07:04 PM)Matt Wrote: [ -> ]I'd also strongly advise not randomly deleting and renaming things without understanding what you're actually doing as you'll end up causing yourself more problems.
I deleted them because, when I was searching for a solution to the extension problem, one of the pages I found recommended deleting the index.html file. Soon afterward the extension disappeared, so I figured it had been good advice. I know now it's bad, and will restore the files to prevent any future problems from cropping up.

And honestly, yes, I would rather delete that from the url as it's pretty much just needless clutter. I would like the domain name I purchased to be what people actually see on the url for the main page, rather than: example.com/index.php, especially because when I entered the url without the extension, it went to a blank page.

Edit: All right, restored all the index.html files (actually, did a complete reinstallation to make sure I didn't miss anything), and used this link to remove the index.php extension on the main page. https://community.mybb.com/thread-77141.html
My original problem still stands, though. :/
(2017-01-13, 07:41 PM)Sethera Wrote: [ -> ]I deleted them because, when I was searching for a solution to the extension problem, one of the pages I found recommended deleting the index.html file. Soon afterward the extension disappeared, so I figured it had been good advice. I know now it's bad, and will restore the files to prevent any future problems from cropping up.

It might have been related for the one in your web root, because index.html is typically the first file served if you don't specify one in the URL, but the ones in the ./cache/ folders would have been entirely unrelated.

(2017-01-13, 07:41 PM)Sethera Wrote: [ -> ]And honestly, yes, I would rather delete that from the url as it's pretty much just needless clutter. I would like the domain name I purchased to be what people actually see on the url for the main page, rather than: example.com/index.php, especially because when I entered the url without the extension, it went to a blank page.

If it went to a blank page it sounds like a misconfigured server, it should pick it up if not put in the URL. Add this to your .htaccess file

DirectoryIndex index.php

<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_URI} ^/index.php
RewriteRule $ / [R=301,L]
</IfModule>
Quote:Edit: All right, restored all the index.html files (actually, did a complete reinstallation to make sure I didn't miss anything), and used this link to remove the index.php extension on the main page. https://community.mybb.com/thread-77141.html
My original problem still stands, though. :/

I'm not sure what problem that is now if the index.php issue has been fixed...
(2017-01-13, 08:29 PM)Matt Wrote: [ -> ]It might have been related for the one in your web root, because index.html is typically the first file served if you don't specify one in the URL, but the ones in the ./cache/ folders would have been entirely unrelated.

If it went to a blank page it sounds like a misconfigured server, it should pick it up if not put in the URL. Add this to your .htaccess file

DirectoryIndex index.php

<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_URI} ^/index.php
RewriteRule $ / [R=301,L]
</IfModule>
Oh okay, well I guess I know the difference now. Thank you. I added that to the .htaccess file too now. The index.php doesn't show up anymore.

(2017-01-13, 08:35 PM)Matt Wrote: [ -> ]I'm not sure what problem that is now if the index.php issue has been fixed...
The original problem is that whenever I change my theme, it leaves GET data in the URL which I'd like to remove. What was solved was the main page having the extension index.php. So basically, I'd also like to remove the extension in the URL that occurs whenever I switch themes.
What's your URL? The redirect added to the .htaccess should take care of this as it redirects away from index.php but doesn't preserve any GET data.
http://roleplayharbour.com
I just added the code you gave me to the end of the .htaccess file which may have something to do with it, but I moved it to just below another If Module and the problem remained. So I guess I'm pretty confused here.
It should be okay anywhere in the file, but it's not redirecting away from index.php for me at all at the moment - did it definitely redirect away when added before?
Pages: 1 2