SMFHacks.com
Modifications/Themes => General SMF Forum => Pretty Urls => Topic started by: SMFHacks on July 13, 2018, 04:24:23 pm
-
If you're experiencing problems with Pretty URLs this page may help you. But first check that your forum is using the latest version of this mod.
Every link causes 404 Not Found errors
If after installing the mod every link is broken, there is probably a problem with your server (it may not support mod_rewrite or per-directory .htaccess configuration files). To fix the links so that the problem can be diagnosed and fixed, or so you can uninstall the mod, create a new .php file with this code:
<?php require_once(dirname(__FILE__) . '/SSI.php'); updateSettings(array('pretty_enable_filters' => '0')); ?>
Upload the file to the same location as your forum's SSI.php and open it with your web browser. Then don't forget to delete it!
Links point to old domain after moving forum or fix HTTPS
This is very simple to fix, in addition to updating all the other settings with repair_settings.php, this mod has one more setting to fix. You can either manually fix the pretty_root_url setting yourself, or else create a new .php with this code:
<?php require_once(dirname(__FILE__) . '/SSI.php'); require_once($sourcedir . '/Subs-PrettyUrls.php'); updateSettings(array('pretty_root_url' => $boardurl)); pretty_update_filters(); ?>
Upload the file to the same location as your forum's SSI.php and open it with your web browser. Then don't forget to delete it!
Sub-directories can't be opened
If you have a sub-directory in your forum directory you will no longer be able to access it as SMF will think you want to open a board with its name (note if you refer to a page in that sub-directory it will work fine.) With one addition to your .htaccess file you can fix this. You may have to change your FTP client's settings in order to see the hidden .htaccess file. This example is for the sub-directory /chat/, which should open /chat/index.html; add it to the top of your .htaccess file (outside the Pretty URLs section!)
RewriteRule ^chat/?$ /chat/index.html [L,QSA]
-
Hi there
Thanks for this great package. I am very new to SMF so trying everything out including getting the site to be more SEO friendly. Upon installing this package for 2.1 RC2. I am coming across the 404 errors across the whole site. I have of course fixed it with the php file as advised.
The issue is that my host reports that mod_rewrite is enabled but it never works. I asked them to look further into this and they came back and said that modsecurity had been enabled for my domain and they have now disabled. Its still not working. I have gone back to them again but I was wondering if anyone here can shed light on anything else that should be checked to ensure that mod_rewrite works.
I have almost given up on this. I am on a host that uses cpanel which apparently has mod_rewrire on by default.
Is there anything else I should be checking?
Many thanks.
-
Make sure .htaccess file has the pretty urls listed inside it as well.
-
I do not know if it is the site but I have a query since when reading and applying what it says above the problem was solved however sometimes it marks me:
https://www.bombercode.net/foro/index.php?action=prettyurls;sa=error;page=404
8: Undefined index: REQUEST_URI
Archivo: /public_html/foro/Sources/PrettyUrls.php
Línea: 727
The line that marks me is $row['body'] = str_replace("%filename",$_REQUEST['REQUEST_URI'],$row['body']); but if you access this url, it visualizes it as it should be ... Can it be due to the configuration used in my accommodation?
Regards!
-
Could be empty if you running a cmd via cron job or manually php via cli
https://stackoverflow.com/questions/48579283/when-request-uri-can-be-empty
-
Could be empty if you running a cmd via cron job or manually php via cli
https://stackoverflow.com/questions/48579283/when-request-uri-can-be-empty
I will look at it thank you very much! ;D
Regards!
-
Hello!
I am running SMF version: 2.0.17
And I am trying to install Pretty URLs 2.3 (replacing Pretty URLs 1.1.3)
Trying to do this via the package manager generates the following error:
Database Error
Specified key was too long; max key length is 1000 bytes
File: /home/forteana/public_html/ghosthuntingforum.co.uk/Packages/temp/SMF2-0/install.php
Line: 39
After multiple failures at getting this to work, I tried to just reinstall Pretty URLs 1.1.3, but that now generates the same error.
I have tried several things to try and fix this, like deleting some tables from the database to try and recreate them, but nothing I have tried has worked.
Any help gratefully received!
-
That's odd...Drop the pretty_urls_cache table from the database.
The max size would be 255...not sure how they get 1000
-
Drop the pretty_urls_cache table from the database.
I tried that already, and it didn't work I am afraid.
-
You can remove the the primary line call array('type' => 'primary', 'columns' => array('url_id')), for the index in the code....but that will cause major slowdowns if your forum gets big....
// Create the pretty_urls_cache table
$smcFunc['db_drop_table']('{db_prefix}pretty_urls_cache');
$smcFunc['db_create_table']('{db_prefix}pretty_urls_cache', array(
array('name' => 'url_id', 'type' => 'varchar', 'size' => 255),
array('name' => 'replacement', 'type' => 'varchar', 'size' => 255),
), array(
array('type' => 'primary', 'columns' => array('url_id')),
), array(), 'overwrite');
-
Links what I read go near the bottom of comments https://dba.stackexchange.com/questions/49913/specified-key-was-too-long-max-key-length-is-1000-bytes-in-mysql-5-6
-
....but that will cause major slowdowns if your forum gets big....
Yeah, I don't want to deviate from any mods normal operation if I can help it, it will just cause more problems later.
-
Links what I read go near the bottom of comments https://dba.stackexchange.com/questions/49913/specified-key-was-too-long-max-key-length-is-1000-bytes-in-mysql-5-6
I must confess that most of this database stuff is Greek to me.
When I try and install the mod it creates the pretty_topic_urls table just fine, but it won't create the pretty_urls_cache table for some reason? I don't know if that helps?
-
Try to run this via phpmyadmin on your database
CREATE TABLE `smf_pretty_urls_cache` (
`url_id` varchar(255) NOT NULL,
`replacement` varchar(255) NOT NULL,
PRIMARY KEY (`url_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
Try to run this via phpmyadmin on your database
CREATE TABLE `smf_pretty_urls_cache` (
`url_id` varchar(255) NOT NULL,
`replacement` varchar(255) NOT NULL,
PRIMARY KEY (`url_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
Running the above query successfully creates the table, trying to install the mod then deletes it, or at least, when I try to install the mod after creating that table, it disappears?
-
Yeah it does you will need to download the mod unzip it.
Find smf2.0/install.zip
and remove this code from it. then rezip it back up.
// Create the pretty_urls_cache table
$smcFunc['db_drop_table']('{db_prefix}pretty_urls_cache');
$smcFunc['db_create_table']('{db_prefix}pretty_urls_cache', array(
array('name' => 'url_id', 'type' => 'varchar', 'size' => 255),
array('name' => 'replacement', 'type' => 'varchar', 'size' => 255),
), array(
array('type' => 'primary', 'columns' => array('url_id')),
), array(), 'overwrite');
-
You did it!!! It works!!!
Thank you so much!!!
-
Glad you have it working! Still a strange issue.
-
I have several other SMF installs, how do I upgrade from the old version of Pretty urls to the new version? Is there tutorial somewhere?
Thanks again for your help!
-
Ideally you uninstall old version then install new when possible.
-
That gives:
HTTP ERROR 500
-
On uninstall That would be tricky. But most of the updates where just the changes from the sources file.
You can do the replacements just overwrite old files. I would do a backup first
-
moved to new host installed fresh smf and reloaded old db now i am trying to enable pretty url as its already in db. but it gives me error when i try and install mod
Specified key was too long; max key length is 1000 bytes
File: /home/customer/www/samplesite.com/public_html/Packages/temp/SMF2-0/install.php
Line: 39
Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0.17, while your database is at version 2.0.10. The above error might possibly go away if you execute the latest version of upgrade.php.
what to do now? where can i find upgrade.php and will that solve this issue ?
-
Replied on smf forum upgrade.php
-
Hello,
I installed pretty urls in a new forum and looks like it is causing me problems.
I ran the maintenance and now it put me out of the admin panel, and I can't access any other pages, only the Home page and boards. Before I saw also an error saying that someone was trying to login as admin, and it was me, I needed to log out as member, and then login and I could access the admin. Then when the time passed, and I needed to login again as admin, it was saying the password was false.
And then like I said above, I can't access the admin panel.
How can I uninstall the Mod manually on my server?
Usually on download page on SMF, there is a list of files a mod installs, and a list of code it changes in several SMF files. Where do you have it?
Another question related with what another member here posted.
make certain and have "index.php?board=" 'allowed' in your robots.txt.
Do you know exactly the code I need to add on my robots.txt file to allow "index.php?board="?
Thanks
-
on my phone but upload package to https://www.smfhacks.com/smf-package-parser.html to reverse edits. You can also disbale the mod doing the script above
robots.txt is for search engines only
-
Thanks, I solved the problem. I want to use the Mod, but, first it doesn't rewrite one of the boards. I created 16 boards distributed by 2 categories, and one of the boards continues with the url /index.php?board=18.0 instead of the name.
I install the mod, and immediately all the urls are correct, only this one not.
I run the maintenance, and no change.
But the biggest problem is when I run maintenance it redirects me to the home page, and I don't have more access to the admin panel.
Please help me. I have this mod since about 10 years ibn a 1.1.8 smf forum, and never had any problems.
-
Install the mod again. But use the pretty urls link under manage boards to change the url.
-
Already tried many times. Not possible. When I change there the url there, than it shows the url this way: https://www.mydomain.com/httpswww.mydomain.comgeneral-discussion
I tried only add there the last part, "general-discussion", so it would be correct, but it is not possible.
And about what happens when I run maintenance. What could be the reason?
-
The pretty urls root could be wrong. check in the smf_settings table. for prettyurls root or reset with making a script from
Links point to old domain after moving forum or fix HTTPS
-
The pretty urls root could be wrong. check in the smf_settings table. for prettyurls root or reset with making a script from
Links point to old domain after moving forum or fix HTTPS
I installed the way I installed all the others mods. I uploaded the prettyurls.zip file to the Packages folder on my server and extracted it there. Then on my admin panel installed it. No errors. Do you think it was not correct?
Do you mean check smf_settings table in the database?
I don't understand what you say about a script because you didn't finish the sentence.
It may have something to do with the redirect to HTTPS, because I analyzed my site to see if all was good, and even google adsense bot could not see it correctly, and other bots said it had a 500 error, but I don't see anything.
Curiously now I tried to access my site using http, and it is not redirecting to https, but, before it was. And I see that in the footer I still see the copyright of one of your plugins, the contact page or the ad management that I paid to remove the copyright and you helped me by email.
But on the https I don't see it. I send it here attached.
I am beginning to think it is better uninstall everything and begin with a clean installation.
-
You make this script
<?php require_once(dirname(__FILE__) . '/SSI.php'); require_once($sourcedir . '/Subs-PrettyUrls.php'); updateSettings(array('pretty_root_url' => $boardurl)); pretty_update_filters(); ?>
Place in root of your forum that execute via browser based on the path.
The copyright is an issue with sources/query-string.php i think.
-
You make this script
<?php require_once(dirname(__FILE__) . '/SSI.php'); require_once($sourcedir . '/Subs-PrettyUrls.php'); updateSettings(array('pretty_root_url' => $boardurl)); pretty_update_filters(); ?>
Place in root of your forum that execute via browser based on the path.
The copyright is an issue with sources/query-string.php i think.
Could you please be more specific? How do I place this code in the code of the forum? In my case, it is the main domain, so it is in my public_html folder, right?
But I think I need to create a file using notepad, and give a name to the file, and only then place it there. If so, which name I give to the file?
What should I look for in the sources/query-string.php file to solve the problem with the copyright?
-
public_html folder. create with notepad. Give any name you wish.
Attach the sources/Query-string.php file here. But I could be mistaken. I haven't looked at prettyurls in a while so i don't remember how the copyright is generated.
-
Ok, I created the file with notepad, and gave the name script.txt
Uploaded to the server in the root directory, and then loaded it on my browser: https://www.mydomain.com/index.php/script.txt
It was supposed to happen something?
I attach here the sources/Query-string.php so you can take a look.
Thanks.
-
needs to end in .php not .txt then run it.
-
I did it. Deleted the first one. Renamed the original on my PC, uploaded it, and the system added .txt in the end automatically. I renamed it again in the server, removing the .txt.
Then ran it. The page reloaded. How do I verify that what you wanted to do with the script was done?
BTW, at the moment I don't have the mod prettyurls installed, so I can access my admin panel.
Should I have it installed while running this script?
-
Yes or you can reinstall pretty urls again and see if it helps.
-
I reinstalled it. That specific board had still that board number in the url. Then I ran the script again. No change.
Then I ran the maintenance. No change. I cleaned the files cache and my browser cache, and still no results.
The problem is that I can delete the board, create a new one, but, it will still be the same. All the other 15 boards have the pretty urls.
Any idea?
-
Whats the name of the board? I have no other ideas...
-
General Discussion but translated in my language.
Could it be because there is a General Discussion board installed by default when we install SMF?
-
Maybe but haven't seen that happen before
-
Ok, I tried a different approach. I created another board under the same category with the name Test, just to see if it would have a number in the URL. No, it was perfect.
Then I changed the name to General Discussion and added the board description. Then I deleted the other one with the number in the url.
All good except that the url of the Test board doesn't change to general-discussion, even after running the maintenance on the pretty urls mod to force the rewrite of the urls.
I really think that has something to do with the default SMF board having this name, and for some reason the software doesn't let the mod rewrite it.
There is some way to change the name of this url from test to general-discussion manually?
-
There should be a Prettyurls link in the boards area next board name to change the url
-
Yes, but like I said yesterday in the reply Nr. 28 in the previous page, it doesn't replace the url but it add to the actual url.
BTW, to be 100% sure it has to do with the default General Discussion board, I just created another board, but this time with the name General Discussion in my language, and immediately the url got the number. Any other name the url doesn't have a number.
Any idea where can I solve this problem? Which mod file should I manually change? Maybe delete some code or insert some? I don't have any experience with code, only very basic things.
Did you take a look in the sources/Query-string.php because of your copyright link?
-
I am kind of busy this week. Towards the end of next week I might have time to look more depth. Right now i am just going based on memory
-
Ok, I will ask for help on smf. If not solved, I will ask you again in about a week or so.
Thanks.
-
Hi,
Do you have time now? I still have the problem with pretty urls, your copyright code of the Contact Page Mod is still there somewhere, and can be seen on Firefox using http. On https I don't see it, but on Chrome it can be seen even using https.
The Like button on the LikePosts Mod also do not show up anywhere.
-
Could you please respond? I paid to delete the copyright and it is still there as you can see in the attachment.
And I still have a big problem with pretty urls too.
-
I can refund your payment pm me your email. I currently do not have time to look into it.
-
I don't need a refund. Just need that you say when you can help with the issues.
-
I don't think i can solve the pretty urls issue.
-
I don't think i can solve the pretty urls issue.
I don't understand anything about code, but one guy like you saying something like that, I don't believe.
You have lots of Mods, years of experience with code, so you know what the problem is. Yes, it may be something difficult and take much time and you can't do it for free, that I understand, but I am sure someone like you can solve it.
At least let me know what you think it is, so I hire someone to solve the problem.
The other small issues I wait until you have time.
-
I didn't make pretty urls originally. Yeah I can probably figure it out if I had time. But I am a full time developer and multi business owner this is not a priority for me.
-
Well, if it is not a priority for you, then please refund the money because I need to pay someone to find and delete the code of your link that is still somewhere in the website.
-
PM me the email or domain used to order.
-
Hello!
Since installing Pretty Urls on my SMF 2.1.2 forums, the Terms and Rules link in the footer of the forums has broken, it links to https://www.forum url/forum/agreement/ instead of to the Terms and Rules page.
Any advice on how to fix this would be greatly appreciated!
Best regards,
Edited to add: What I meant is that https://www.forum url/forum/agreement/ redirects to a blank page, not to the Terms and Rules page. I switched off Rewrite Action URLs in the Pretty Urls setting and that seems to fix it.
-
Anything in the error log. I tested on SMF 2.1.2 forum and seems ok with that action.
-
Nothing there currently. All I kept getting were messages telling me that registration was disabled because of the lack of a privacy policy.
-
To uninstall pretty urls do I still need a removal tool, or will uninstall in the package manager work?
-
Uninstall with package manager.
There is a urlreverter tool if you want to make sure old links redirect instead of 404 errors.
-
Where can I find the urlreverter tool?
-
Here https://www.smfhacks.com/index.php/topic,9675.0.html
-
Ok, it says "It seems that you are not allowed to download or view attachments on this board."
-
Is there any other way to get this file? Anyone?
-
Added it on https://www.smfhacks.com/index.php?action=downloads;sa=view;id=235
-
Wonderful, thank you!
-
Ok, I just tried to use the reverter and got the following message: "The package you are trying to download or install is either corrupt or not compatible with this version of SMF."
I am using SMF 2.1.2, any help or advice appreciated.
-
Currently don't have a 2.1 SMF version of that package yet.
-
Hi, I am getting this error. How can I resolve it?
Fatal error: Cannot redeclare PrettyBoardUrls() (previously declared in /home/customer/www/mywebsite.com/public_html/Sources/ManageBoards.php:916) in /home/customer/www/mywebsite.com/public_html/Sources/ManageBoards.php on line 1012
Any help would be appreciated.
-
Looks like the mod installed twice. Remove the duplicate code follow manual install options and just reverse it.
https://www.smfhacks.com/smf-package-parser.html
-
Hey, I have a small issue with Pretty Urls. Basically when "Enable URL rewriting" is enabled on SMF 2.1 then plain external links without bbcode turn into burning-brushes.pl///link.com and when I disable it then it's fine, but maybe I can add something to "Skip Actions List" so it doesn't happen? (here (https://burning-brushes.pl/oferty-pracy/gdzie-szukac-pracy-jako-grafik/)'s a live example)
-
What was the link? I posted your example on my test site was not getting that to happen.
What were your pretty url settings?
Do you have other mods installed that might affect posting?