Jump to content
joeck

[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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By ce90
      Hello everyone,
      hopefully this is the right place to ask and is not a duplicate question.
      I'm pretty new to processwire, so... if this question is kind of funny for some of you, you're welcome 😄 
      I have the following issue and can't find anything understandable about it. Maybe I'm searching the wrong way, but anyways.. here is my question:

      How is it possible to rewrite the URLs, that I'll get a *.php ending?
      Example:
      https://www.mysite.de/urlsegment/ -> https://www.mysite.de/urlsegment.php
      https://www.mysite.de/urlsegment/urlsegment/ -> https://www.mysite.de/urlsegment/urlsegment.php
      Because I've read a lot about "Why do you wanna do this or have that?" – here my answer for that in advance:
      I've built a processwire installation inside or around an existing website. Therefore, we want to keep the existing *.php Google entries. Sure, we could redirect via 301 Redirect, but would prefer to keep the *.php ending.
      If you have further questions, please do not hesitate to ask.
      Thank you in advance for your help.

      Best regards
      ce90
    • By Orkun
      Hi Guys
      How can I make a redirect inside the .htaccess to my custom maintenance.html file when any URL of my Website is accessed except the processwire admin (www.example.com/processwire/).
      Because I want that my User's still can access the website when they are loggedin in Processwire.
      When the current url starts with /processwire or if there is a processwire-login-cookie (Is there a cookie when user is logged in Processwire?) available the redirect should not work. Otherwise it should work.
      How can I achieve this?
    • 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?
×
×
  • Create New...