Dennis Spohr

Use other domain to show sub-page

3 posts in this topic

Hi all,

this is my first post here - so let me say first: I love ProcessWire! :rolleyes:

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

Share this post


Link to post
Share on other sites

Hi Christophe,

yes I saw the module. But not sure if it solves my problem, especially because it doesn't seem to be compatible with my ProcessWire version. I get some errors after installation.

I use PW 3.0.42.

Thanks,
Dennis

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 sanjom
      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.
    • By cosmicsafari
      Hi all,
      I am creating a page field (field of type FieldtypePage) via the API, however im still trying to find some documentation as to how I would go about setting the Selectable Pages for said field using the API.
      From what I have found it looks like it involves the use of, albeit this looks like a getter rather than a setter:
      $field->getInputfield($page) Which looks like it would make sense if I wanted to specify the selectable pages by a parent page, but what if I wanted to specify it by say a template?
    • By holmescreek
      Summary: If I have a site sitting on a server called testing.com, then on the server change it to mycompany.com, do I have to modify any settings in ProcessWire?
      After building several processwire for clients, the one question that I haven't had is about moving a processwire site from an old (temporary) domain to a new domain.
      For instance, I typically setup development sites for clients and register a temporary domain (and lock with a password). For instance, thee client can go test.com and get all their content finalized, change wording, add news, swap out photos -- everything to make the site production read.  
      Next, on my hosting account I can have testing.com renamed to theircompany.com - and change the nameservers.
      A simple question here. If I have a hosting company rename the account from testing.com to theircompany.com, change my nameservers whereas going to theircompany.com loads the production site, Is there anything I need to change in the processwire configuration or in the PW database?
      In the past, I've just manually copied the site, and fresh-installed PW, and imported the data. Seems like a lot of hassle.
      I have a second part question about updating the PW core, however, after consideration I'll post it as a new topic.
    • By bmacnaughton
      When I delete a page name, e.g, /cart/, using the admin interface it goes into trash and gets the name /trash/2573.1.11_cart/ .
      I see that, with the Pages::trashed hook that the previous page name (previousPage) can be accessed.
      Where can I more information about what happens when a page is put into trash and what the name means?
    • By bmacnaughton
      I have a hook that creates a page for a subset of the pages on our site. It uses the saved page's name as part of the created page's name.
      The problem I am having is that my hook, attached to Pages::saved(), is being called even when the page save failed because of missing fields. Is there a way I can tell that the page save failed due to missing fields?
       
      Never mind - it does succeed; it just issues warnings about required fields.