joelplambeck

[SOLVED] htaccess not all modules supported

Recommended Posts

Hi Guys,

I'm trying to do my first migration to the customers existing server (IIS 10) . I ran the site as a subdirectory on my website for test purposes (everything works fine).
Following the tutorial of Joss, I tryed the site on a local xampp server to make sure, it also works on a root directory. So far so good, everything works.

Now I moved the files (from the xampp) to the customers server. The root/index page is shown but for every subpage i get 404 Errors...

Hence I followed the troubleshooting guide for not working URLs:

On the first sight, the .htaccess file is not recognized, therefore I contacted the host support. They said, it is recognized but not all modules are supported in the processwire .htaccess file. I did the "öalskjfdoal" test in the .htaccess file and didn't get a 500 Error.... BUT the rewrite rule from the hosts support, to proof the file is read, DID work... The support claims, they do not provide debugging... so basically the .htaccess file is recognized and working, but not throwing any errors (for whatever reason).

Working rewrite rule (from support):

RewriteEngine On
 RewriteBase /
 RewriteRule ^test\.asp$ index.html [NC,L]
 RewriteRule ^test\.html$ konzept.html [NC,L]
 RewriteRule ^test2\.html$ team.html [NC,L]

The support said, a couple modules are not supported in the htaccess file, the supported ones are listed here: http://www.helicontech.com/ape/ (I think mod_rewrite is supported)

As I do not completely understand what exactly is happening in the htaccess file, I'm stuck. I tried all suggestions I found regarding this topic on the forum, but none of them solved the problem.

 

.htaccess.txt

Share this post


Link to post
Share on other sites
Quote

The root/index page is shown but for every subpage i get 404 Errors...

That´s a classical problem. Is your site in the root or in a subdirectory ?
Did you check Allow/Override is configured on your hosting ?
Is your processwire config still pointing to localhost ?
Set debug mode on in your config file. $config->debug = true; to see any error messages.

 

 

  • Like 1

Share this post


Link to post
Share on other sites
Quote

Is your site in the root or in a subdirectory ?

It is in the root directory

4 hours ago, pwired said:

Did you check Allow/Override is configured on your hosting ?

No, I'm awaiting an answer from support. But I think it is configured, as the rewrite rules are working (see attachement).

$config->debug is set to true, but this is not helping as the server is displaying its own 404 Error page, hence I do not see if the config is still pointing to localhost.
I tried to change the servers 404 error page to the /index.php (as in the htaccess file) but this just gave me the index.php page, no matter which link is clicked.

PS: the CSS and some modules CSS are not linked properly as well, maybe this helps in finding the error

 

.htaccess.txt

Share this post


Link to post
Share on other sites
6 minutes ago, joelplambeck said:

hence I do not see if the config is still pointing to localhost.

the idea was to check /site/config.php to confirm the details in $config->httpHosts were correct.

Share this post


Link to post
Share on other sites
13 hours ago, joelplambeck said:

I did the "öalskjfdoal" test in the .htaccess file and didn't get a 500 Error...

Hmm, that means .htaccess file is not working. What happens if you remove the rewrite rules provided by your support? What errors are shown? Apache logs, what do they say?

  • Like 1

Share this post


Link to post
Share on other sites

The $config->httpHosts is set to the root of the customers website (with and without www.*)

1 hour ago, kongondo said:

Hmm, that means .htaccess file is not working. What happens if you remove the rewrite rules provided by your support? What errors are shown? Apache logs, what do they say?

The logs I found do not state a request to the htaccess file... and I still don't get an error with 'asölkdfjasldfj' on first line... As if the server doesn't even care... :-(

In the attachement you find logs with both version of the htaccess file (with and without the 'laksjdföadsf' error)

log.txt

Share this post


Link to post
Share on other sites

OK. But what error do you get in the browser when you remove your supports rules (i.e., using PW .htaccess file as is).. Do you get a 500 Error or 404 Error?

Share this post


Link to post
Share on other sites
1 hour ago, kongondo said:

OK. But what error do you get in the browser when you remove your supports rules (i.e., using PW .htaccess file as is).. Do you get a 500 Error or 404 Error?

I get the exact same error (404 on subpages, index.php is working)

The rules added from the support are not helping me (for the migration) in any way, they simply prove that the htacces file is working/read (somehow).

To be specific: the rules are regarding the old site and simply rewrite a not existing url to an existing url  */test.html to */angebot.html (from the old website/structure). But the new website built with PW has a different (more organised) structure.

I hope my explanation is not too confusing :undecided:

Share this post


Link to post
Share on other sites

You have a backup of your website and database, right ? So, delete everything in the root and database of your Host and then do a fresh new processwire installation. That will tell you if your Host has any restrictions yes or no. As soon as you can do a fresh new processwire installation on your host, you can compare both the .htaccess and the config.php files with the ones you have in your website backup.

  • Like 2

Share this post


Link to post
Share on other sites
19 hours ago, joelplambeck said:

I get the exact same error (404 on subpages, index.php is working)

OK. However, index.php will work even without .htaccess. 

19 hours ago, joelplambeck said:

The rules added from the support are not helping me (for the migration) in any way, they simply prove that the htacces file is working/read (somehow).

This is what I am confused about. If the .htaccess file is working, you should have seen a server 500 error when you added random gibberish text at the very top of the htaccess file. If you didn't, it means the htaccess is not getting read. Maybe repeat the test to confirm?

Could these posts be of help to you?

 

  • Like 1

Share this post


Link to post
Share on other sites

Thank you for your help!

It works now using the web.config file from @matjazp in his post.

special thanks to @kongondo for linking me to the correct topics ^-^

It really is true: PW has a great, friendly and extremely helpful community!

Share this post


Link to post
Share on other sites

Excellent! Glad we got there in the end :).

  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By neophron
      Hi there,
      a few weeks ago I completed a 3.098 installation (server php 7.2). Yesterday I wanted to login but failed. I tried different browsers, meanwhile on two different PCs, but no login.
      Then I realized, that after hitting the »Login« button, there was no message (admin name – Login failed). I also tried all procedures (https://processwire-recipes.com/recipes/resetting-admin-password-via-api/). Then I checked the errors.txt (site/assets/logs) – nothing.
      The frontend works fine. Is there a way to check this Processwire installation? Could be something missing?
       
    • By horst
      Hey,
      I want to hook into the 404 handling of PW at the most earliest stage. Pleas can anybody point me to the hook or file that suits this best?
    • By zota
      Hi,
      After 2 or 3 cliks on my nav bar the browser starts to show
      http://julio.x10host.com/home/juliox15/public_html/logos/
      instead of
      http://julio.x10host.com/logos/
      Where or what should I start the fixing?
      Thanks
    • By franciccio-ITALIANO
      Hi, I must change server provider.
      I don't want rewtrite all page and articles, what must I do?
      I download a database copy on my pc, and now?

      Thanks!!
    • By Jennifer Stock
      Greetings. I would like to restrict access to certain sections of my organization's ProcessWire site using pubcookie. We are rolling out Shibboleth authentication later this year but for now, it seems I can only make use of our institution's single sign-on routine by utilizing rules in an .htaccess file. 
      I am wondering if there is a way to ask PW to apply these rules to certain pages in the site, whether via template type or location in the page tree:
      AuthType UWNetID PubcookieAppID "MyApplication" require type staff faculty