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 louisstephens
      So I have a project where multiple pages are sending POST data to 1 single template page.  All was working well (well, at least with one ajax post), but now I have hit a stumbling block. I figured  the "best" way to handle the request were to use url segments and then use the following in the status page:
      if ($config->ajax && $input->urlSegment1 == 'add-bookmark') { // some code here } However, this doesnt seem to really work (as I assume the the request isnt being posted to /status/ but rather to /status/add-bookmark/). What is the best way to actually handle this?
    • By dweeda
      How do I migrate a template with all its fields and values to a new site? Is their an export/import process?
    • By dweeda
      I installed an SSL Certificate, then edited my .htaccess file:
        # -----------------------------------------------------------------------------------------------
        # 9. If you only want to allow HTTPS, uncomment the RewriteCond and RewriteRule lines below.
        # -----------------------------------------------------------------------------------------------
        RewriteCond %{HTTPS} off
        RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
      by uncommenting out the Rewrite lines.
      Now I get 404 error pages when I try go to any .../processwire-master/<pagename>/
      This includes my admin page at .../processwire-master/processwire/, so i can't get into my admin.
      What else do I need to do?
    • By pwfans
      Hello,
      1. Anybody can help, why this htaccess (location in root) doesn't work at 3.0.98 ? it show 404
      RewriteEngine on RewriteRule ^(.*)$ /subdirectory/$1 [L] That rule works in 3.0.62
      It redirect root request to subdirectory processwire installation and hiding the subdirectory name in url.
      I have try to uncomment htaccess inside subdirectory processwire installation :
      RewriteBase /pw/ to RewriteBase /subdirectory/ Doesn't help, still 404 when open the site from root domain.
      2. Is there anyway to find processwire version from processwire files ? not from admin login page.
      Thank you.