bearclaw

Website Works Perfect On Local Host, On Server I Can't Access /login Page. What's Wrong?

Recommended Posts

Hello guys I'm new here!

I've been working on this website that I've made with Foundation. I wanted to put a CMS in it so now i'm here!

On my localhost the website works perfect. I've adjusted the Processwire CMS to my wishes and with /login I and other users would be able to change the texts on the website. So I thought I was ready to put it live. I exported the MySQL files. Created a new db. Imported everything. And via an FTP client uploaded all the files. The homepage works fine. But now whenever I want to login using /login which I changed /processwire to I get a 404 error:

Not Found

The requested URL /login was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

What am I doing wrong here?

I've checked a lot of messages on this forum about the .htaccess file but I haven't got it to work yet and need help from more experienced PW users:)

 

This is my website: http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

 
  # -----------------------------------------------------------------------------------------------
  # Access Restrictions: Protect ProcessWire system files
  # -----------------------------------------------------------------------------------------------
 
  # Block access to any htaccess files
  RewriteCond %{REQUEST_URI} (^|/)\.htaccess$ [NC,OR]
  # Block access to protected assets directories
  RewriteCond %{REQUEST_URI} (^|/)(site|site-[^/]+)/assets/(cache|logs|backups|sessions|config|install|tmp)($|/.*$) [OR]
  # Block acceess to the /site/install/ directory
  RewriteCond %{REQUEST_URI} (^|/)(site|site-[^/]+)/install($|/.*$) [OR]
  # Block dirs in /site/assets/ dirs that start with a hyphen
  RewriteCond %{REQUEST_URI} (^|/)(site|site-[^/]+)/assets.*/-.+/.* [OR]
  # Block access to /wire/config.php, /site/config.php, /site/config-dev.php, and /wire/index.config.php
  RewriteCond %{REQUEST_URI} (^|/)(wire|site|site-[^/]+)/(config|index\.config|config-dev)\.php$ [OR]
  # Block access to any PHP-based files in /templates-admin/
  RewriteCond %{REQUEST_URI} (^|/)(wire|site|site-[^/]+)/templates-admin($|/|/.*\.(php|html?|tpl|inc))$ [OR]
  # Block access to any PHP or markup files in /site/templates/
  RewriteCond %{REQUEST_URI} (^|/)(site|site-[^/]+)/templates($|/|/.*\.(php|html?|tpl|inc))$ [OR]
  # Block access to any PHP files in /site/assets/
  RewriteCond %{REQUEST_URI} (^|/)(site|site-[^/]+)/assets($|/|/.*\.php)$ [OR]
  # Block access to any PHP files in core or core module directories
  RewriteCond %{REQUEST_URI} (^|/)wire/(core|modules)/.*\.(php|inc|tpl|module)$ [OR]
  # Block access to any PHP files in /site/modules/
  RewriteCond %{REQUEST_URI} (^|/)(site|site-[^/]+)/modules/.*\.(php|inc|tpl|module)$ [OR]
  # Block access to any software identifying txt files
  RewriteCond %{REQUEST_URI} (^|/)(COPYRIGHT|INSTALL|README|htaccess)\.(txt|md)$ [OR]
  # Block all http access to the default/uninstalled site-default directory
  RewriteCond %{REQUEST_URI} (^|/)site-default/
  # If any conditions above match, isssue a 403 forbidden
  RewriteRule ^.*$ - [F,L]
 
  # ----------------------------------------------------------------------------------------------- 
  # Ensure that the URL follows the name-format specification required by ProcessWire
  # ----------------------------------------------------------------------------------------------- 
 
  RewriteCond %{REQUEST_URI} "^/~?[-_.a-zA-Z0-9/]*$"
 
  # -----------------------------------------------------------------------------------------------
  # If the request is for a file or directory that physically exists on the server,
  # then don't give control to ProcessWire, and instead load the file
  # ----------------------------------------------------------------------------------------------- 
 
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !(favicon\.ico|robots\.txt)
 
  # -----------------------------------------------------------------------------------------------
  # OPTIONAL: Prevent ProcessWire from attempting to serve images or anything in /site/assets/. 
  # Both of these lines are optional, but can help to reduce server load. However, they
  # are not compatible with the $config->pagefileSecure option (if enabled) and they 
  # may produce an Apache 404 rather than your regular 404. You may uncomment the two lines
  # below if you don't need to use the $config->pagefileSecure option.
  # ----------------------------------------------------------------------------------------------- 
 
  # RewriteCond %{REQUEST_FILENAME} !\.(jpg|jpeg|gif|png|ico)$ [NC]
  # RewriteCond %{REQUEST_FILENAME} !(^|/)site/assets/
 
  # ----------------------------------------------------------------------------------------------- 
  # Pass control to ProcessWire if all the above directives allow us to this point.
  # For regular VirtualHosts (most installs)
  # ----------------------------------------------------------------------------------------------- 
  RewriteRule ^(.*)$ index.php?it=$1 [L,QSA]
 
  # ----------------------------------------------------------------------------------------------- 
  # 500 NOTE: If using VirtualDocumentRoot: comment out the one above and use this one instead.
  # ----------------------------------------------------------------------------------------------- 
  # RewriteRule ^(.*)$ /index.php?it=$1 [L,QSA]
 
</IfModule>
 
#################################################################################################
# END PROCESSWIRE HTACCESS DIRECTIVES
#################################################################################################
 
 
What am I doing wrong? 
 
Thanks in advance!

htaccess.txt

Share this post


Link to post
Share on other sites

Looks like you have to set a RewriteBase (just delete the # in front of the first line "RewriteBase /" or if your installations lays in a subfolder change it to "RewriteBase /subfolder/")


And please check if modrewrite is installed on your server: http://stackoverflow.com/questions/9021425/how-to-check-if-mod-rewrite-is-enabled-in-php

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for the quick reply.

But I still get the same error when my .htaccess file looks like this:

    RewriteBase /www/
  # RewriteBase /wp/
  # RewriteBase /~user/
 
My sit is in the /www folder. 
 
I've also checked if modrewrite is installed. When I search in the phpinfo() for Mod_Rewrite or anything like that it is not finding anything. 
Als these funcitons are disabled: apache_child_terminate,apache_get_modules,apache_note,apache_setenv
 
Does that mean that moderewrite is not installed on the server?
 
Kind regards,
 
Joris

Share this post


Link to post
Share on other sites

Yes. So you should contact your hoster and ask if he could add it or allow it for your account. Or if this is a custom server you have to install it yourself..

Share this post


Link to post
Share on other sites

You could try "RewriteBase /" as your side is accessable via ""http://www.josbeerepoot.nl/www/".

Edit: Should have read more closely. You need to have ModRewrite installed before you check this :)

  • Like 1

Share this post


Link to post
Share on other sites

I "solved" this topic by choosing your answer as the "solving answer". If you should still have any further questions you can undo this and just post here again. Or start a new topic ;)

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 Robin S
      Breadcrumb Dropdowns
      Adds dropdown menus of page edit links to the breadcrumbs in Page Edit.

      Installation
      Install the Breadcrumb Dropdowns module. The module requires ProcessWire >= v3.0.83 and AdminThemeUikit.
      There is a checkbox option in the module config that determines if the breadcrumb dropdowns will include pages that the user does not have permission to edit.
      Features/details
      The module adds an additional breadcrumb item at the end for the currently edited page. That's because I think it's more intuitive for the dropdown under each breadcrumb item to show the item's sibling pages rather than the item's child pages. In the dropdown menus the current page and the current page's parents are highlighted in a crimson colour to make it easier to quickly locate them in case you want to edit the next or previous sibling page. Unpublished and hidden pages are indicated in the dropdowns with similar styling to that used in Page List. If the option to include uneditable pages is selected then those pages are indicated by italics with a reduced text opacity and the "not-allowed" cursor is shown on hover. There is a limit of 25 pages per dropdown for performance reasons and to avoid the dropdown becoming unwieldy. If the current user is allowed to add new pages under the parent page an "Add New" link is shown at the bottom of the breadcrumb dropdown. If the currently edited page has children or the user may add children, a caret at the end of the breadcrumbs reveals a dropdown of up to the first 25 children and/or an "Add New" link. Overriding the listed siblings for a page
      If you want to override the siblings that are listed in the dropdowns you can hook the BreadcrumbDropdowns::getSiblingsmethod and change the returned PageArray. For most use cases this won't be necessary.
      Incompatibilities
      This module replaces the AdminThemeUikit::renderBreadcrumbs method so will potentially be incompatible with other modules that hook the same method.
       
      https://modules.processwire.com/modules/breadcrumb-dropdowns/
      https://github.com/Toutouwai/BreadcrumbDropdowns
    • By MischaK
      I'm someone who has been developing websites for a while, mostly doing full stack .NET development and ASP scripting before that, while using Silverstripe and some other PHP frameworks for some smaller projects which worked well enough for quite some time. 
      Now I have some time on my hands and decided to evaluate some different CMS options. 
      Diving in as a newbie into: 
      Wordpress 
      Processwire 
      CraftCMS
      After a short while I decided that Wordpress was out while I'm still evaluating Craft and Processwire. 
      My question is, is there any interest here in reading about my experiences in trying to get the feature set I want up and running, with these other systems?
    • By gnanasekar
      Hello All,
      Hope all doing good, I am a newbie to processwire. I have an issue please help me out!!!
      Here is my question:
      I have two usernames with one email apparently. when rebuilding my Jenkins server, I get a failed to authenticate and now I cannot reset the password of the other account. Any help would be appreciated.
      Thanks
    • By Thomas Diroll
      Hi guys I'm relatively new to PW and just finished developing a page for a client. I was able to include all necessary functionality using the core fieldtypes but now I it seems that I need to extend them with a custom one. What I need is a simple button, that copies the absolute url (frontend not PW-backend) of the page which is currently edited to the clipboard. As this feature is only needed inside a specific template, I tend to use a custom fieldtype which provides this feature. I've been looking inside the core modules code (eg. FieldtypeCheckbox.module) but I don't really get the structure of it and how its rendered to the admin page. I also didn't find a lot of tutorials covering custom fieldtypes.
      Maybe some of you could give me some tips on how to write a basic custom fieldtype that renders a button which copies the value of
      page->httpUrl() to the clipboard using JS. 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