The following warnings occurred:
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
/printthread.php 203 postParser->parse_message
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
/printthread.php 203 postParser->parse_message
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
/printthread.php 203 postParser->parse_message
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
/printthread.php 203 postParser->parse_message
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
/printthread.php 203 postParser->parse_message
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
/printthread.php 203 postParser->parse_message
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
/printthread.php 203 postParser->parse_message
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
/printthread.php 203 postParser->parse_message
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
/printthread.php 203 postParser->parse_message
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
/printthread.php 203 postParser->parse_message



GetSimple Support Forum
.html extension in page's url - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: .html extension in page's url (/showthread.php?tid=5507)



.html extension in page's url - yojoe - 2014-01-13

Howdy
I've stumbled upon a problem after modifying an old, static website.
After converting /*.html pages to GS, old links ceased to work.
There's no problem with rewriting them using mod_rewrite.
But I'd like to get the possibility to do it from within GS admin panel, just by adding .html in the page's url field.

clean_url() function inside basic.php stripes unnecessary chars from url, and after modifying it I'm able to save the page with fake .html extension.
But that's not all what I needed to change, as I get 404error while visiting such page.
Could anyone point me to the right function where I could tweak the code to achieve the goal, or maybe there's another, supersimple solution ?


RE: .html extension in page's url - hameau - 2014-01-13

(2014-01-13, 06:41:53)yojoe Wrote: Could anyone point me to the right function where I could tweak the code to achieve the goal, or maybe there's another, supersimple solution ?

Personally, I would search/replace the site content and get rid of the old .html extensions on static links. I think that would be the most reliable way and the least likely to cause problems in the future.

For a quick-and-dirty solution, could you add to the base .htaccess:
Code:
AddType application/x-httpd-php .html
?


RE: .html extension in page's url - yojoe - 2014-01-13

(2014-01-13, 19:13:48)hameau Wrote: Personally, I would search/replace the site content and get rid of the old .html extensions on static links. I think that would be the most reliable way and the least likely to cause problems in the future.
Well, no. That's not the case. There are other methods to point to new content, but the case is dead simple: let GS handle extension in url through page's options. html extension is a default one, but making it work, there should no problem with using any string after dot.

(2014-01-13, 19:13:48)hameau Wrote: For a quick-and-dirty solution, could you add to the base .htaccess:
Code:
AddType application/x-httpd-php .html
?
This rule forces php parser to handle existing .html files. It just can't work.
It would be great to know if it's possible just by changing 1-2 basic functions. I'm not fond of deep changes in GS core.

edit: there's a "Link Juice" plugin, but redirecting 404s to index isn't still the right solution :\


RE: .html extension in page's url - Everyone - 2014-01-13

This may sound stupid but have you tried anything from here?


RE: .html extension in page's url - hameau - 2014-01-13

In that case, I don't really understand you problem, however:
(2014-01-13, 19:39:31)yojoe Wrote:
(2014-01-13, 19:13:48)hameau Wrote: Personally, I would search/replace the site content and get rid of the old .html extensions on static links. I think that would be the most reliable way and the least likely to cause problems in the future.
Well, no. That's not the case. There are other methods to point to new content, but the case is dead simple: let GS handle extension in url through page's options. html extension is a default one, but making it work, there should no problem with using any string after dot.

Modifying a standard system (GS, in this case) to overcome a deficiency elsewhere (your old content) is rarely a good engineering solution. StackOverflow is full of similar questions with suggestions for .htaccess rewrite rules.


RE: .html extension in page's url - shawn_a - 2014-01-14

Use a custom rewrite rule and a permalink structure.
I am fairly certain this exact scenario was covered in forums somewhere.

In fact the bottom of the page that everyone posted shows exactly how its done.


RE: .html extension in page's url - yojoe - 2014-01-14

You assume all pages have .html extension. They do not.
It's a mix, where those with .html (any possible extension) should get incoming traffic instead of showing the visitor a 404, or redirecting him to /index
Custom link structure with rewrite rules won't cover that.

hameau: I don't think I'd be able to create rewrite rules with exceptions for files with and without extension. StackO. won't be helpful, as there would have to be people who are familiar with GS sourcecode. And who might be more familiar than people visiting this forum ? Wink

But GS custom link structure is a hint. I'll look at function(s) responsible for it.


RE: .html extension in page's url - shawn_a - 2014-01-14

If it is only some then just redirect them all to the new structure.
I don't really understand what the problem is.

redirect all (*).html to index.php?id=$1
or rewrite so it is transparent.

all can be done in htaccess.

If you want to handle it in gs only, then use the errro404 hook and map the .html to the slug and return the content.
3.3.0 makes this even easier with 2 new filters.


RE: .html extension in page's url - hameau - 2014-01-14

(2014-01-14, 01:55:26)yojoe Wrote: You assume all pages have .html extension. They do not.
...
Custom link structure with rewrite rules won't cover that.

Of course it can – that's what rewrite conditions are for.

(2014-01-14, 01:55:26)yojoe Wrote: I don't think I'd be able to create rewrite rules with exceptions for files with and without extension.

Well, it's certainly possible. If you mean, you don't have the experience to create the rules, I understand: neither do I. But I'm sure Google knows how. Sometimes it's necessary to learn about stuff that isn't an every-day problem ... In the 24 hours that you've been asking for help here, you probably could have found everything you need.

If I have still misunderstood, then I apologise for being abrupt.


RE: .html extension in page's url - shawn_a - 2014-01-14

There is already a rewrite rule exception for files and directories in our htaccess.