News:

Wondering if this will always be free?  See why free is better.

Main Menu

Pretty URLs

Started by SMFHacks.com Team, January 31, 2007, 10:56:43 AM

Previous topic - Next topic

vbgamer45

Did you do this step
Once you have https you would need to change your prettyurls url you can do it on this page
http://code.google.com/p/prettyurls/wiki/TroubleShooting
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

power505

After installation went fine, I tried to enable URL rewriting, but got this error:

Parse error: syntax error, unexpected ''' (T_ENCAPSED_AND_WHITESPACE) in /var/www/vhosts/wwwmyurl/public_html/forum/SSI.php on line 1806

This is my 1806 line in SSI.php

// Show the most recent events.
function ssi_recentEvents($max_events = 7, $output_method = 'echo')
{
global $db_prefix, $user_info, $scripturl, $modSettings, $txt, $context, $smcFunc;

if (empty($modSettings['cal_enabled']) || !allowedTo('calendar_view'))
return;

// Find all events which are happening in the near future that the member can see.
//1806 line // $request = $smcFunc['db_query']('', '
SELECT
cal.id_event, cal.start_date, cal.end_date, cal.title, cal.id_member, cal.id_topic,
cal.id_board, t.id_first_msg, t.approved
FROM {db_prefix}calendar AS cal
LEFT JOIN {db_prefix}boards AS b ON (b.id_board = cal.id_board)
LEFT JOIN {db_prefix}topics AS t ON (t.
//end of file


SMF version: 2.0.10

vbgamer45

Attach your SSI.php looks like it is cut off...
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

power505

https://drive.google.com/file/d/0BwHJVZHeLiG4WkRVUzlaNHFWXzg/view?usp=sharing [nofollow]

It's uploaded on Drive. It sure is cut off, but I do not know how it happened

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

power505


power505

Please help. After applying your code there are double posts popping all over the forum. Should I delete cache files or something?

vbgamer45

No idea i copied if from the normal SSI.php from SMF. You might have to ask in SMF support
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

richardwbb

I have ran in to something, which I don't understand. I'm not good with reading .htaccess rules, but when I type an url of which I know it doesn't exist, I expect Apache to come up with a 404. It didn't, and I noticed just after I went to https. So what did I do, I've used repair settings, removed the https redirect in .htaccess and ran the ' updateSettings(array('pretty_root_url' => $boardurl))' called over http, to make sure the forum was running without https. Expecting this would solve the lack of a proper 404, this didn't help.

So I took a copy of the live forum and database, and run this on my local server. The Apache I'm running is 2.2 version and the ISP is running 2.0. Then I renamed .htaccess, to make it run without htaccess. Then, a proper 404 was generated both with the ISP and on my local server. Then I removed everything from .htaccess. besides pretty urls settings, and there was no 404 any longer.

By removing the pretty urls settings partly, I learned that;# Rules for: boards
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1.0 [L,QSA]
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/([0-9]*)/?$ ./index.php?pretty;board=$1.$2 [L,QSA]


has to be removed to get a proper 404. I can't read what '^', '+', or '$' means or have a poor understanding of it. I couldn't find a clear manual explaining this, and while I have been looking to those two rewrite rules, I also can't tell there is something inside it, that makes Apache do a redirect to '/' instead of giving a 404 response. It does this with https and http. I hope you can shed some light on this, pretty urls won't be removed but it would be proper to know that spiders receive a correct response,  because it does happen that something isn't there any longer and this way the spides hopefully will update their index.
If my post in this topic looks ambiguous to you, then I'm with Murphy's law and General Stupidity. In other words, trial and error.

vbgamer45

There is no 404 option for links right now. Any url that matches that rewrite rules above is considered valid.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

richardwbb

Okay. I made sure [as far as it goes], 404's won't occur and keep an eye on it, since search engines [offer to] send messages with issues. Thanks.
If my post in this topic looks ambiguous to you, then I'm with Murphy's law and General Stupidity. In other words, trial and error.

hamav8tor

Finally updated from 1.x to 2.0.13 - everything works great except that notification emails are missing $scripturl at the beginning of each email, so there is no hyperlink to the forum post. This is happening with the default (Curve) theme...the only theme being used. I am running Pretty URLs (latest version) with SMF 2.0.13. I am told this may have something to do with the Pretty URLs mod.

Excerpt from one of the notification emails (New Topic email):

"
You can see it at
/forum-name/topic-name/new/#new
"

Note that this forum is being run under SSL but that shouldn't matter. In the database I had to set pretty_root_url to '' in order to make the URLs work....prior to that they had the hxxp:hostname.com/forums/ [nonactive]... in the links - this was also part of a switch to a hxxp:forums.hostname.com [nonactive] switch - prior to the switch it was https://hostname/com/forums as the root URL.

Any ideas appreciated - maybe I need to put the pretty_root_url back and run a maintenance task in Pretty URLs?

vbgamer45

Strange. Do you have any other mods installed?
Was there any failures on install?
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

hamav8tor

No failures on install.

The following mods are installed:

1. Simple Audio Video Embedder   4.0.2   
2. Ad Managment   3.2   
3. Tapatalk SMF 2.0 Plugin   4.4.1
4. Pretty URLs   1.1.3

hamav8tor

Fixed the issue by simply setting pretty_root_url again to root URL of new site. No ill effects this time.

vbgamer45

Glad you have it working now
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

richardwbb

Hey,

I didn't expect it, but it was possible to make 404's redirect to 'ErrorDocument 404' [inside htaccess]. I wrote that I would keep an eye on the search engines, but it kept popping up in my mind, since htaccess isn't easy and there are usually more ways then just one to accomplish the same thing with htacces. It doesn't give much of error output and, when something works, it might break something else, and it's order of rules can become an obstacle to verify if everything is [still] working properly.

By looking into RewriteRule - L, it basically says, htaccess stops processing when that rule applies. So that meant to me, it won't consider the second rule, ever. Now I've got it working, I figured that with testing all possible combinations, which are; write '#' before 'second rule', or, before 'first rule', and 'swap rules'. I didn't investigate this in depth, for example, I've chosen to put a hash before the second 'topics', rule, but this rule didn't seem to affect 404 redirect in the first place. Also, as you can see, I've enabled Pretty URLs, just for boards and topics, though I don't expect problems with that,YMMV.

Finally, the ultimate test, exclude second rule, test, then; exclude first rule, test, and swap rules without excluding, might learn why you said Pretty URL's doesn't support 404 redirects. It just doesn't make sense [to me], that I find by testing, that the second rule is never considered, since the first rule contains 'L', together with swapping the first rule for the second and vice versa while that [the last test, make the rules appear vice versa], doesn't enable the working order of 404 redirects. That I find contradicting.

Here is the code;# PRETTYURLS MOD BEGINS
# Pretty URLs mod
# http://code.google.com/p/prettyurls/
# .htaccess file generated automatically on: February 23, 2017, 21:28

RewriteEngine on
RewriteBase /forum

# Rules for: boards
#RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1.0 [L,QSA]
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/([0-9]*)/?$ ./index.php?pretty;board=$1.$2 [L,QSA]

# Rules for: topics
#RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1;topic=$2.0 [L,QSA]
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*|msg[0-9]*|new)/?$ ./index.php?pretty;board=$1;topic=$2.$3 [L,QSA]

# PRETTYURLS MOD ENDS


I'm hoping you can tell me how this contradiction is possible, and of course, if you can agree, that this is working properly without introduction of [new] drawbacks. This setup is working with my local Apache 2.2, with the providers Apache 2.0 and it is running in the live forum without complaining of the visitors or their remarks pointing to this change they can't be aware of.
If my post in this topic looks ambiguous to you, then I'm with Murphy's law and General Stupidity. In other words, trial and error.

tanawat

hello

May I ask 3 Question

1.if i disable (as picture) then enable again, will any link urls be change? or any bad result?



2.if i cant  enter admin page, how to disable it?

3.if i want to delete mod, i do the  following 
     (1) disable URL rewriting (as picture)
     (2) delete mod by commonly
Anything else need to be changed?

Thank you.

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

moneyman125

silly question, I just installed prettyurls but I have no idea where to find the url rewrite setting in my smf admin panel.  ???

I have the latest smf version and prettyurls version.

All the admin options are now on the left side of the admin panel now with the latest smf forum version... they used to be at the top.

Thanks anyone that can help  ;)

Advertisement: