Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 12411
Latest: PabloWatts
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 39950
Total Topics: 7033
Most Online Today: 66
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 44
Total: 44

Author Topic: prettyurls - TroubleShooting.wiki  (Read 4280 times)

0 Members and 1 Guest are viewing this topic.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 14980
    • View Profile
prettyurls - TroubleShooting.wiki
« 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:

Code: [Select]
<?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:
Code: [Select]
<?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!)

Code: [Select]
RewriteRule ^chat/?$ /chat/index.html [L,QSA]
« Last Edit: August 31, 2019, 06:46:15 am by SMFHacks »
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline alitech

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: prettyurls - TroubleShooting.wiki
« Reply #1 on: October 05, 2019, 09:15:28 pm »
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.

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 14980
    • View Profile
Re: prettyurls - TroubleShooting.wiki
« Reply #2 on: October 08, 2019, 10:48:27 pm »
Make sure .htaccess file has the pretty urls listed inside it as well.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Rock Lee

  • Pretty Urls SEO Pro
  • Newbie
  • *****
  • Posts: 28
    • View Profile
    • Bomber Code ~ La nueva era del conocimiento
Re: prettyurls - TroubleShooting.wiki
« Reply #3 on: October 09, 2019, 05:49:30 pm »
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:

Code: [Select]
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!

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 14980
    • View Profile
Re: prettyurls - TroubleShooting.wiki
« Reply #4 on: October 09, 2019, 07:12:33 pm »
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
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Rock Lee

  • Pretty Urls SEO Pro
  • Newbie
  • *****
  • Posts: 28
    • View Profile
    • Bomber Code ~ La nueva era del conocimiento
Re: prettyurls - TroubleShooting.wiki
« Reply #5 on: October 10, 2019, 11:37:09 am »
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!

 

Related Topics

  Subject / Started by Replies Last post
7 Replies
5696 Views
Last post October 07, 2006, 11:43:40 pm
by Nite
1 Replies
2458 Views
Last post September 14, 2014, 09:46:47 am
by SMFHacks
0 Replies
1597 Views
Last post May 31, 2017, 10:49:05 pm
by SMFHacks
0 Replies
597 Views
Last post July 13, 2018, 04:22:02 pm
by SMFHacks
0 Replies
859 Views
Last post July 13, 2018, 04:23:01 pm
by SMFHacks

+- Recent Topics

hashTags only used by admins, but visible to everyone? by SMFHacks
December 08, 2019, 05:09:23 pm

Responsive Layout by Matthias
November 30, 2019, 03:05:57 pm

Secure connection failed Pretty Url Pro by Rock Lee
November 26, 2019, 10:44:23 am

Black Friday Sale Week 2019 by SMFHacks
November 23, 2019, 04:47:56 pm

German Translation missing in SMF 2.1R1 by SMFHacks
November 19, 2019, 02:38:42 pm

Unread items issue by SMFHacks
November 19, 2019, 10:07:32 am

Update detect mobile mode PHP5 to PHP7 by Rock Lee
November 16, 2019, 07:18:13 pm

PHP error by davejo
November 12, 2019, 12:09:47 pm

Message Editor Pro Issues by SMFHacks
November 06, 2019, 09:58:33 pm

most popular categories doesnt work by fussilet
November 02, 2019, 02:51:42 pm

Powered by EzPortal