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

eolith

  • Wanting to get Wedge on my forums!
  • Posts: 28
Pretty URLs causing 404s
« on February 12th, 2014, 03:08 PM »
I see Pretty URLs are working here, but when I enable Pretty URLs of any sort on my site, I get 404s for the prettified URLs. Nothing in the error log. Brand new install, discovered as I was going through the admin settings to match an SMF forum I run.

For others that may encounter this, here are the URLs to paste into the address bar to undo the pretty URLs:


Load this URL:
Code: [Select]
http://YOURWEDGE.COM/index.php?action=admin;area=featuresettings;sa=pretty

Deselect the Pretty URL (actions)

Paste this URL and hit enter:
Code: [Select]
http://YOURWEDGE.COM/do/admin/?area=featuresettings;sa=pretty;save

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Pretty URLs causing 404s
« Reply #1, on February 12th, 2014, 03:25 PM »
AFAIK, admin pages don't use pretty URLs at all, mostly to help against PURL issues, so if you just navigate to ?action=admin, it should be enough...

Did you enable action rerouting with /action, rather than /do/action, by any chance..?

Also, don't forget that Wedge needs the install/.htaccess file to be moved to the root, if you're going to use PURLs. Was this done..?

eolith

  • Wanting to get Wedge on my forums!
  • Posts: 28
Re: Pretty URLs causing 404s
« Reply #2, on February 12th, 2014, 05:20 PM »
the admin pages do switch to .../do/admin... and break.

I hadn't moved the .htaccess before (what did I miss that gives the instruction?), but I did this time, and it makes no difference.

I did not try the /action instead of /do/action because that option is not available until after you turn on pretty URLs, and then the Save button no longer works because it leads to 404s (all admin pages are now 404s), and I don't know what URL would work to make that change.


If it matters, I'm hosted on GoDaddy, deluxe linux package as a subfolder to my main forums (which run SMF).

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Pretty URLs causing 404s
« Reply #3, on February 12th, 2014, 05:46 PM »
Quote from eolith on February 12th, 2014, 05:20 PM
the admin pages do switch to .../do/admin... and break.

I hadn't moved the .htaccess before (what did I miss that gives the instruction?),
Well, I don't know, but I've repeatedly said it.
I guess it should be mentioned in the Pretty URLs page itself, but it isn't the case.
That's mostly because /install used to be a folder where one was supposed to move all files to the root. Since this is no longer necessary, I tend to dismiss the fact that you still need to move some of the files to the root, if you want all features.
Quote from eolith on February 12th, 2014, 05:20 PM
but I did this time, and it makes no difference.
I did not try the /action instead of /do/action because that option is not available until after you turn on pretty URLs, and then the Save button no longer works because it leads to 404s (all admin pages are now 404s), and I don't know what URL would work to make that change.
What URL is being shown in your address bar when it shows a 404..?
Quote from eolith on February 12th, 2014, 05:20 PM
If it matters, I'm hosted on GoDaddy, deluxe linux package as a subfolder to my main forums (which run SMF).
Hmm, can't find anything at fault here. What Apache version..? (Admin > Server > phpinfo)

eolith

  • Wanting to get Wedge on my forums!
  • Posts: 28
Re: Pretty URLs causing 404s
« Reply #4, on February 12th, 2014, 08:06 PM »Last edited on February 12th, 2014, 09:11 PM
Quote from Nao on February 12th, 2014, 05:46 PM
Well, I don't know, but I've repeatedly said it.
I guess it should be mentioned in the Pretty URLs page itself, but it isn't the case.
That's mostly because /install used to be a folder where one was supposed to move all files to the root. Since this is no longer necessary, I tend to dismiss the fact that you still need to move some of the files to the root, if you want all features.
Yeah, I figured it was something like that. I jumped in without doing too much reading. Too excited to see a running install of Wedge :)
For the record, other than the .htaccess file, I have not moved anything from /install into the root folder.
Quote from Nao on February 12th, 2014, 05:46 PM
What URL is being shown in your address bar when it shows a 404..?
Normally it's this:
Code: [Select]
http://www.exile-guild.com/wedge/index.php?action=admin

After turning it on, it's this:
Code: [Select]
http://www.exile-guild.com/wedge/do/admin/[/url]
Quote from Nao on February 12th, 2014, 05:46 PM
Hmm, can't find anything at fault here. What Apache version..? (Admin > Server > phpinfo)
I'm assuming the "apc" section is Apache: 3.1.13. I've attached the full PHP information page as a pdf.

 eolith-PHP Information.pdf - 264.56 kB, downloaded 100 times.


Pandos

  • Living on the edge of Wedge
  • Posts: 635
Re: Pretty URLs causing 404s
« Reply #5, on February 13th, 2014, 03:59 PM »
If you are running fcgi, please change the following to 1 in php.ini:
cgi.fix_pathinfo
# dpkg-reconfigure brain
error: brain is not installed or configured

eolith

  • Wanting to get Wedge on my forums!
  • Posts: 28

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Pretty URLs causing 404s
« Reply #7, on February 13th, 2014, 05:02 PM »
Search PHP set_ini on google. This fonction might help you force that setting.

It's a good idea to explore forcing it in wedge.
In the meantime, add it at the start of index.php in your root. Not the very start of course. After the define calls for instance. Keep us posted.

Pandos

  • Living on the edge of Wedge
  • Posts: 635

Nao

  • Dadman with a boy
  • Posts: 16,079
Re: Pretty URLs causing 404s
« Reply #9, on February 13th, 2014, 05:15 PM »
I'm not sure how this directive would have any influence over Wedge's PURLs, though...
I'm still curious, but...

Also, the instruction is ini_set('cgi.fix_pathinfo', 1);
I said set_ini, it wasn't. Sorry, I wasn't on my computer.

Pandos

  • Living on the edge of Wedge
  • Posts: 635
Re: Pretty URLs causing 404s
« Reply #10, on February 13th, 2014, 05:18 PM »
Wedge expects the URL to be passed along as a PATH_INFO variable. CGI and FastCGI implementations of PHP do not have PATH_INFO available, so when trying to pass the URI along, PHP fails.

Nao

  • Dadman with a boy
  • Posts: 16,079

Pandos

  • Living on the edge of Wedge
  • Posts: 635
Re: Pretty URLs causing 404s
« Reply #12, on February 13th, 2014, 07:00 PM »
Hmm..
Disabling fastcgi in .htaccess?
Code: [Select]
Options +ExecCGI
addhandler x-httpd-php5-cgi .php

But GoDaddy says:
Quote
You cannot disable FastCGI with our cPanel shared hosting accounts.

eolith

  • Wanting to get Wedge on my forums!
  • Posts: 28
Re: Pretty URLs causing 404s
« Reply #13, on February 13th, 2014, 11:24 PM »
I added the ini_set function as described above at the location indicated below. I still get 404s

Code: [Select]
define('WEDGE_VERSION', '0.1');
define('WEDGE', 1); // We are go.

// attempt to disable fCGI
ini_set('cgi.fix_pathinfo', 1);

// Get everything started up...
if (function_exists('set_magic_quotes_runtime') && version_compare('5.4.0', PHP_VERSION) > 0)
@set_magic_quotes_runtime(0);

Re: Pretty URLs causing 404s
« Reply #14, on February 13th, 2014, 11:34 PM »
I have no idea how to work with .htaccess, but I gave this a try right at the top:

Code: [Select]
<Directory "/">
Options +ExecCGI
addhandler x-httpd-php5-cgi .php
</Directory>

that just stopped my server from working, got an Internal server error until I adjusted it.