This topic was marked solved by Nao, on April 14th, 2014, 10:28 AM
Pretty URLs causing 404s

Pandos

  • Living on the edge of Wedge
  • Posts: 635
# dpkg-reconfigure brain
error: brain is not installed or configured

eolith

  • Wanting to get Wedge on my forums!
  • Posts: 28
Re: Pretty URLs causing 404s
« Reply #16, on February 13th, 2014, 11:39 PM »
doesn't hurt to try ;) Also, I've never seen the term "cPanel" applied to my account.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Pretty URLs causing 404s
« Reply #17, on February 14th, 2014, 12:26 AM »
Only way I can fix this (or at least try to find out what caused this) would be, at this point, to have FTP + forum admin accounts to your forum.
Sorry about that, but... Dunno what it's doing for you, really.

eolith

  • Wanting to get Wedge on my forums!
  • Posts: 28
Re: Pretty URLs causing 404s
« Reply #18, on February 14th, 2014, 07:13 AM »
I've created an account for you and sent you a PM with the details. Please let me know what you find.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Pretty URLs causing 404s
« Reply #19, on February 14th, 2014, 09:05 AM »
I mostly need ftp access to play with htaccess ;)

Don't worry I'm not going to abuse it. If anything you can just give me a custom account limited to your wedge folder.

eolith

  • Wanting to get Wedge on my forums!
  • Posts: 28
Re: Pretty URLs causing 404s
« Reply #20, on February 14th, 2014, 03:01 PM »
oh yeah... that's what I get for posting after having a few drinks with a buddy... :P check your PMs

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Pretty URLs causing 404s
« Reply #21, on February 15th, 2014, 12:16 AM »
Ah yes, thanks..!
I'll look into it tomorrow. I'll have to juggle with House of Cards too, it's quite tempting, but I think I'll focus on Wedge first, because I have yet to commit all of my big changes from the last couple of days... (The 'hey' bit in the members table; changes to the settings file; modular main htaccess; and most importantly, the upgrade script!)
Remind me if I haven't been there by tomorrow night!

eolith

  • Wanting to get Wedge on my forums!
  • Posts: 28
Re: Pretty URLs causing 404s
« Reply #22, on February 15th, 2014, 12:32 AM »
No problem. Thank you, sir, for your personal attention. I know you must be busy.

Gerriet

  • Posts: 18
Re: Pretty URLs causing 404s
« Reply #23, on February 15th, 2014, 02:14 PM »
Hello all ;D

I have the same problem with the clean or pretty url, but I know that with rewrite mod over apache get better. So make that wordpress and another software too. But I am no a dev ...

Here a link to a wikipedia artice ;D
http://en.wikipedia.org/wiki/Clean_URL

Greetings

Gerriet

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Pretty URLs causing 404s
« Reply #24, on February 16th, 2014, 01:58 PM »
Okay, so here's what happened...

*If your Wedge forum is installed in a sub-folder*
And
*If your server is Apache 2.2.16 or better*

Wedge is falling back to the FallbackResource /index.php line in the htaccess file.

However, /index.php is an absolute URI, and thus it redirects to your www root's index.php, rather than your Wedge root's.
I used to do index.php without the slash, but it actually uses the current requested path as relative path, instead of the htaccess file's path. What does it mean..? Well, doing /wedge/profile/me/ will attempt to load wedge/profile/me/index.php, instead of wedge/index.php...

The solution (which I applied to eolith's forum):

Well, err... As stupid as it sounds, just get rid of the FallbackResource lines. And the version testing lines. Basically, below the "# Pretty URLs" line, just keep this:

Code: [Select]
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]
</IfModule>

It obviously takes more time than just FallbackResource... :-(

Now it all comes down to the fact that I've been working on making Wedge create the htaccess file automatically.
If I can't get the Apache version number (eolith's server doesn't disclose it >_<), I'd have to print the above code instead of the easier FallbackResource. But what if you then upgrade your Apache server..? You could then use the faster FallbackResource, but Wedge wouldn't know. Well, I guess you could 'simply' remove your htaccess file from time to time, and Wedge would recreate it with the latest available code, but... Anyway.

Sometimes, a compromise has to be found between ease of use and ease of development... Hmm.

eolith

  • Wanting to get Wedge on my forums!
  • Posts: 28
Re: Pretty URLs causing 404s
« Reply #25, on February 16th, 2014, 09:17 PM »
I think I understand about 83% of that... :P

Thank you very much for that modification and the work to make it happen.

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Pretty URLs causing 404s
« Reply #26, on February 16th, 2014, 11:47 PM »
I took the easy way out (i.e. the coward's way), by removing all traces of FallbackResource, but it really hurts... :lol:
Still, first impressions are more important than later optimizations.