Search the Community

Showing results for tags 'htaccess'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Found 34 results

  1. Hey, I've used ProcessWire for a while now but not made an appearance in the forum yet I just wanted to share the solution to a small problem I came across with Let's Encrypt (free SSL service). Let's Encrypt SSL certificates need to be renewed every few months to remain active. My web host does this automatically but needs access to a folder named ".well-known", which ProcessWire blocks by default because it starts with a dot. This results in a 403 error. To work around this, just add the following line to your .htaccess file, around line 150: RewriteCond %{REQUEST_URI} !^(/\.well-known) It should be the first condition in the section titled "Access Restrictions: Keep web users out of dirs that begin with a period". I also ran into another problem. Let's Encrypt accesses mail.example.com which is redirected to www.mail.example.com because I enabled the redirection in my .htaccess fie. So we need to exclude the mail sub domain from that rule using the following line as the second condition in the www-redirection section (around line 160): RewriteCond %{HTTP_HOST} !^mail\. [NC] I know it's quite a specific problem but maybe it'll help someone Googling the issue. I was curious, is there any way of redirecting to the www-version without having to exclude all your sub domains? The only way I can think of involves explicitly writing out your domain name in the .htaccess file and redirecting whenever the %{HTTP_HOST} starts with that name. But obviously that would lead to a loss of generality.
  2. Hi all, this is my first post here - so let me say first: I love ProcessWire! I have the following scenario: On my website users will be able to create their own site. This site is a page (in this case 'theirsite'): "www.mydomain.com/theirsite" Now I want that they can use their own domain. So this domain needs to load their page: "www.theirdomain.com" goes to "www.mydomain.com/theirsite" but while showing the first domain in the browser. I'm trying to archive this with an htaccess entry: RewriteCond %{HTTP_HOST} www\.retuschierenlernen\.de RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?it=retuschierenlernen/$1 [L,QSA] I get the following error, because it loads the my main site, not the page of my user: Warning: file_put_contents(/www/mysite/test/html/site/assets/cache/FileCompiler/site/templates/public-site.php): failed to open stream: Permission denied in /www/mysite/test/html/wire/core/FileCompiler.php on line 327 Thanks! Dennis
  3. Trying to do some ajax calls to an api named somedomain.com/xapi/index.php using intercoolerjs in my home page. I'm trying to make calls like this in intercoolerjs. somedomain.com/xapi/controller/method. Looked through a bunch of the posts but nothing seems to match what I am trying to do. Is there a change I can make to the htaccess file to get this to work? Anyone have a suggestion on this or is there a better way to handle the api?
  4. I have a VueJS single page app with a router, how do I redirect all requestes to the index.php page? The processwire .htaccess file is quite big I am not sure how to change it. This is what is suggested in the router docs: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.html$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.html [L] </IfModule>
  5. Long time listener, first time caller... I have been working with ProcessWire for some time now and it has been amazing, my go to CMS. Previously my workflow had a local development setup through MAMP using an address like http://localhost:8888/websites/example.com. I have recently changed this in preference of http://dev.example.com, that way I do not need to disable the .htaccess forward from non-www to www to develop locally. My .htaccess forward is setup like: RewriteCond %{HTTP_HOST} !^dev\. [NC] RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] This works on all sites that are still using ProcessWire 2.5, however on sites using 2.8 and 3.0 I am getting a 403 Forbidden error. After reading through the forum posts related to 403 errors I have not been successful in finding a solution for my issue. Has anyone experienced this or can assist? Thank you very much in advance, the forum community has been so helpful I have never needed to post until now.
  6. I have web hosting with the following .htaccess en root, to point it to a subdirectory "audino.us", wherein I have PW installed: RewriteEngine on RewriteCond %{HTTP_HOST} ^(www.)?something.com$ RewriteCond %{REQUEST_URI} !^/something.com/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /audino.us/$1 RewriteCond %{HTTP_HOST} ^(www.)?something.com$ RewriteRule ^(/)?$ something.com/index.php [L] RewriteCond %{HTTP_HOST} ^(www.)?something.com$ RewriteRule ^(/)?$ something.com [L] However when I go to audino.us/pw to access the admin, it becomes audino.us/audino.us/pw, and doesn't allow me to log in. How do I render the above to be recursive (?), i.e., to apply to all subordinate URLs? Is this to be done within the .htaccess in /audino.us, or in the root .htaccess above? Please help, I can't log in. Thanks much.
  7. I am a newbie installing for the first time. I am on a Mac and get /.htaccess doesn't exist. Before continuing, you should rename the included htaccess.txt file to be .htaccess (with the period in front of it, and no '.txt' at the end)., but I cannot start a filename in OS X with a period - at least that is what the OS tells me in a message. What do I do? Is there some trick or workaround I can use? I can't be the only one to have faced this problem. Thanks all! David
  8. Hey all, things had been going well remapping a site from one domain to another, but hit a snag and have searched for hours and don't know how to continue. 1) I was moving everything from thepaleofix.com to dranthonygustin.com 2) I moved every single path individually with redirects like this: Redirect 301 /category/post http://www.dranthonygustin.com/category/post Everything smooth sailing until today when through webmaster tools (to say site address as moved) I had to execute "Redirect 301 / http://www.dranthonygustin.com" -- now some of the urls go through and some don't include the / after the .com extension. For example: http://www.thepaleofix.com > http://www.dranthonygustin.com no problem http://www.thepaleofix.com/resource/purepharma-m3-review/ > http://www.dranthonygustin.com/what-does-magnesium-do/ no problem BUT a bunch of the URLs then don't push... For example: http://www.thepaleofix.com/recipe/paleo-jam > http://www.dranthonygustin.comrecipe/paleo-jam/ (notice NO / after the .com extension) and http://www.thepaleofix.com/wp-admin > http://www.dranthonygustinwp-admin (which of course leads to dead link) There are a bunch of paths that do this, that I checked before and were working, such as: Redirect 301 /recipe/paleo-jam http://www.dranthonygustin.com/simple-vanilla-berry-paleo-jam/ Any idea why after implementing the / redirect, why it broke some of the redirects and not all? Thanks!
  9. Hi all, I'm experimenting building a content site based on AngularJS and Processwire. I‘ve turned on the html5Mode in angularjs, everything works so far re agularjs routing, but when I try to refresh a page, only loads a page without header (thus no js/style). This to me seems a classic problem with server setup ( http://stackoverflow.com/questions/16569841/reloading-the-page-gives-wrong-get-request-with-angularjs-html5-mode/16570533#16570533 ), which requires htaccess setup (I'm on Apache server). But not quite sure how to set up the htaccess? Attached is my htaccess, with below are some routing settings of angular: scotchApp.config(function($routeProvider,$locationProvider) { $routeProvider .when('/news', { templateUrl : 'news', controller : 'mainController' }) .when('/about', { templateUrl : 'about', controller : 'aboutController' }) .otherwise({ templateUrl : 'news', controller : 'mainController' }); $locationProvider.html5Mode(true); }); THANKS advance for all your help! htaccess.txt
  10. Hi, I'm running several speed tests for my personal site using http://webpagetest.org. My site has the ProCache module installed. The lifespan is set to 1 week, but I am not sure it is the same as the expire date seen in the following report : WebpageTest for guyverville.com. Setting Expire Headers can be done in .htaccess. I don't want to interfere with ProCache, but would like to understand what I can do here. Thanks
  11. Hello, I need to redirect the old paths after migration to a multisite PW installation. There are 3 domains and small differences between paths i.e. old path: domain-2/?text new path: domain-2/text or domain-2/new_text I try it via .htaccess (in the root direction) with an 301 redirect: redirect 301 domain/old_path domain/new_path -> generates an 500 server error What is wrong? How to do that?
  12. Hi folks, I have a PW site set up in the root of a domain, (reachable via domain.com/index.php, and domain.com/pw), with an static index.html and respective directory index entry in .htaccess added (DirectoryIndex index.html index.php ), since the site is still in development. Now, suddenly, this is not working anymore, entering domain.com/index.php redirects to the root (and thus the .html), although I can still reach domain.com/pw just fine! I had a look at the htaccess changes since I recently updated from 2.x to 3.0.6, including .htaccess, but there didn't seem to be any difference (not counting the added directory index entry of course) to the old, working htaccess. Can anybody share any clue on what might be off here? Cheers guys! Phil
  13. I moved an old site to processwire and want to redirect the old URLs with php-filenames to the new folders via .htaccess to match the new structure. I tried: RedirectMatch 301 /filename.php http://example.com/filename/ The Browser end up like this: http://example.com/filename/?it=filename.php Its interfering with that Processwire .htaccess rule # ----------------------------------------------------------------------------------------------- # 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] If i comment that out the redirect in the URL is ok, but every Klick on a websitelink is showing the homepage. Any idea how i can fix this? Thanks Andreas
  14. Hi I'm having a strange problem and can't figure out what's going on. On my processwire installation from time to time (very rarely actually, about 1 every 2 motnhs) my htaccess file is overwritten with an almost empty file, only containing: AddHandler x-mapp-php5.4 .php3 .php4 .php .phtml Maybe someone on here has experienced that before? Thanks for any help Peter
  15. Hi there, I'm having issues installing the latest PW version. Upon installing i get this weird error message «mysql 1146 table doesn't exist», although it does. I went through the forum and looked for answers elsewhere on the internet, couldn't find a solution. I tried to comment out a few things in the .htaccess, as often suggested, and went so far as to comment out everything, it still won't work. I can get to the frontend every now and again, i can even log into the backend sometimes. But most of the time i get a «Internal Server Error» message. I contacted the hoster but they think it's an issue with PW and not with they're hosting (of course ;-). Any suggestions as to how to fix it? Thanks!
  16. Hello, I work on a PW version of this site : http://www.moulindelapipe.com The PW works at this URL: http://www.moulindelapipe.com/v2/ When I move the files at the root, I've an error 500. When I try to change each 500 notes or rewrite base in the htaccess, nothing works more. Remember that it works in /v2/ ! After, I rename .htaccess in htaccess.txt and the error still remains... No PW logs in the assets about this error. But in the server logs : PHP Fatal error: require(): Failed opening required '/srv/data/web/vhosts/www.moulindelapipe.com/htdocs/v2/wire/core/autoload.php' (include_path='.:/usr/share/php:/srv/data/web/includes') in /srv/data/web/vhosts/www.moulindelapipe.com/htdocs/v2/wire/core/ProcessWire.php on line 18 Like it still load the v2 when I load the root index... and at this time, there's nothing in this /v2/ directory as I've moved them at the root. Does anyone understand something? Thanks for your help!
  17. Hi Guys, I have processwire installed on a site which was working fine up until very recently. I am getting the error Unrecognized HTTP host: My config file is as follows; $config->httpHosts = array( 'localhost', // our primary hostname 'corrymeela-cms.3sixtynearlythere.co.uk', // staging server 'www.corrymeela.org' // Live server ); I have updated the htaccess file to the most recent. I cannot update any content at the minute I am getting this error: Cannot be published until errors are corrected Can anyone help please? Warmest wishes, Mel
  18. Hi, I've been using PW for a while now, and I've been happy with it so far, but I've decided to stop using .htaccess files on my server as it severely impacts performance. I've tried moving the contents of PW's .htaccess file into my website's virtual host config file. The problem is, once I do that, I can't access my website, as the server just throws 400 Bad Request errors all over the place. So, is there a way to get PW to run without having an .htaccess file in place, that is, having its directives in an Apache virtual host config file instead? Thank you, and happy new year!
  19. Hello everyone, I have a problem with a password protected folder. When I try to access it, I get a «404 page not found» error. First, here is the file structure: / - public_html - guestcal - admin (protected) - wire - site - etc … The protection was created through my hosts backend. This automatically created a .htaccess file in the folder «admin» with the following content: AuthType Basic AuthName "Administration Kellervermietungen" require valid-user AuthUserFile "/home/schloss2/.htpasswds/public_html/guestcal/admin/passwd" I have an alternative url to the site from my host (http://server47.cyon.ch/~schloss2/). When I prepend this instead of the domain name in the browser, the url (http://server47.cyon.ch/~schloss2/guestcal/admin) works fine. I have zero experience with .htaccess stuff … Is there a conflict with pw? Can someone help? Thanks a lot, tron1000
  20. Hi there, I am kinda new to PW but I gave it a try for a current project and I am pretty amazed so far. It really works great and allthough I have pretty much no knowledge about PHP I can wrap my mind around these functions and also get lots of my queries working. My site is almost complete but I also struggeling with a problem which is the following. I am building a website for a music label. They want to provide a dedicated press and download area where press people can download latest press releases, music, artworks and stuff like this. The site structure should be like this: www.domain.com - Page 1 - Page 2 - and so on and the press area which should be www.domain.com/press The link to the press area is not visible on the main website. The page is hidden and should have a simple protection with htaccess. No user or login / member management required. Just a simple htaccess password protection. How can I do that? What I would normally do is just create a folder "press" on my FTP directory where I put the htaccess and thats it but how can I accomplish this in PW? I also provide downloads on that press page. These files for download have been uploaded via the backend and now sit in the assets/file folders. How can I protect them from being downloaded? I want to achieve that once people got access to www.domain.com/press that they are also able to download these files. Maybe its a simple task but I am not sure how to do this properly. Thanks for your help - I really appreciate all that kind support here in the forum! Cheers, Martin
  21. 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 FoundThe 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
  22. Hello everyone, I'm new here but I'm really looking forward to using this amazing tool to help me complete a new project. I am currently developing a site using a web based database named Omeka for a local art gallery. They have thousands of works available in their archives and their current non dynamic website is no longer able to keep up with its content. The cms that will be handling all of the content is amazing for dealing with objects and their associated metadata, but when it comes to its ability to create custom content it just doesn't have enough tools. So after much searching I came upon processwire, and I am really excited. So here is what I am hoping to achieve. Omeka handles the objects. Processwire handles the pages within the site that need to be curated. So what I currently have is several views that include in the body of the website that are pointed to paths in processwire’s directories and an iframe in my admin panel that points to processwire’s admin panel to create the feeling of a plugin. Where I am now struggling is how I should approach hiding the view’s path from the web, but still allowing them to be included in the rest of the project. Thank you in advance!
  23. Hi, I have deployed a PW 2.4 site to a shared domain as an addon domain. The URL is http://www.upasana.ca. I have run into the following issues: 1. If I use the .htaccess file that ships with PW 2.4 I get an "Internal Server Error". I have PW 2.3 sites as addons and they are working. If I copy the .htaccess file from PW 2.3 the site appears to work. The main site is a PW 2.3 site so I don't know if there is a conflict between the addon domain having PW 2.4. 2. I am getting an unstyled login and admin system. I think this might be permissions. When I check the permissions for the /wire folders they are 755 and files are 600. I do not know if the files should be 644 but I don't want to mess with the wire folders unless I know what is supposed to be there. Thanks, Anthony
  24. For best practice best-of-scotland.co.uk redirects to www.best-of-scotland.co.uk and this was done by adding these lines to the core htaccess file: RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] However, we also have a mobile site working on a parked domain using this method: index.php has the following lines changed to make sure the site directory is hard coded instead on a variable $config->urls->siteModules = "site/modules/"; $assetsDir = "site/assets"; $config->urls->adminTemplates = is_dir("site/$adminTplDir") ? "site/$adminTplDir/" : "$wireDir/$adminTplDir/"; I copied index.config.php from wire to the root and added these line: function ProcessWireHostSiteConfig() { return array( 'mobile.best-of-scotland.co.uk' => 'site-mobile', 'best-of-scotland.co.uk' => 'site', 'www.best-of-scotland.co.uk' => 'site', ); } The problem is that I can't get the two to work together. If I remove the www redirect from the htaccess file the mobile site works. Adding it in stops it working. Can anyone help here please? Or is there a better method for delivering mobile sites? Thanks Mike
  25. Hi all, after a longer time working with processwire without stumbling over any issues, I now have come across one (probably only due to my lack of knowledge of rewrite rules). What I want to do, is redirect mydomain.com/index.php to mydomain.com with a 301. This should also work for all subdomains as well as without any subdomain. How can I do this without messing up the rewrite rules for friendly urls etc. in the .htaccess ? I'm a little afraid to just go and do this by trial and error, as it has to be done on a production site... Any help is appreciated!