The following warnings occurred:
Warning [2] Undefined array key "threadviews_countguests" - Line: 745 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 745 errorHandler->error_callback
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 861 postParser->parse_message
/showthread.php 916 build_postbit
Warning [2] Undefined property: MyLanguage::$thread_modes - Line: 46 - File: showthread.php(1650) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1650) : eval()'d code 46 errorHandler->error_callback
/showthread.php 1650 eval




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Child pages, slugs and URLs
#2
RobA Wrote:I just noticed (realized) that child/parent relationships are not "enforced" when using pretty URLs.
...
Does anyone have any suggestion on how to enforce the URL structure and make only the first work?

-Rob A>

1. Change the RewriteRule in your .htaccess file to allow only one and two levels, something like:
Code:
RewriteRule ^([A-Za-z0-9_-]+)/?$ index.php?id=$1 [QSA,L]
RewriteRule ^([A-Za-z0-9_-]+)/([A-Za-z0-9_-]+)/?$ index.php?id=$2&parent=$1 [QSA,L]
(Not sure about the order or the flags, you'll have to try or read the apache doc)

2. Write a plugin, which tests the parent parameter in the hook index-pretemplate and shows 404 Page not found, if it is incorrect.

3. Submit the plugin to Extend ;-)
I18N, I18N Search, I18N Gallery, I18N Special Pages - essential plugins for multi-language sites.
Reply


Messages In This Thread
Child pages, slugs and URLs - by RobA - 2011-06-17, 00:37:05
Child pages, slugs and URLs - by mvlcek - 2011-06-17, 00:50:20
Child pages, slugs and URLs - by Carlos - 2011-06-17, 01:06:19
Child pages, slugs and URLs - by RobA - 2011-06-17, 04:06:34
Child pages, slugs and URLs - by Carlos - 2011-06-17, 05:34:26
Child pages, slugs and URLs - by yojoe - 2011-06-17, 08:12:12
Child pages, slugs and URLs - by Carlos - 2011-06-27, 05:54:33



Users browsing this thread: 1 Guest(s)