Rewriting

Alles, was den Apache betrifft, kann hier besprochen werden.

Rewriting

Postby BobNL » 09. April 2018 16:42

Hi there,

Since moving my website into a subfolder called site, I'm using the following code in my .htaccess to redirect visitors.

Code: Select all
RewriteCond %{REQUEST_URI} !^/site/
Rewriterule ^(.*)$ site/$1 [L]


Works perfect for the main part. The reason for moving my website, is that I would like a second folder, beta, for developing a new website.

Unfortunately, the rewrite also works out for this folder. The result is that beta.domain shows the website in site with some broken links, instead of the content of beta.

What is the right way to configure this? All normal traffic should go to site, just beta.domain to beta.
BobNL
 
Posts: 3
Joined: 09. April 2018 16:33
XAMPP version: ?
Operating System: Shared hosting.

Re: Rewriting

Postby Nobbie » 09. April 2018 21:57

Of course simply create a virtualhost beta.domain and define DocumentRoot as you like. No rewrite necessary at all.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Rewriting

Postby BobNL » 10. April 2018 05:31

And what if my provider doesn’t support vhosts?
BobNL
 
Posts: 3
Joined: 09. April 2018 16:33
XAMPP version: ?
Operating System: Shared hosting.

Re: Rewriting

Postby Nobbie » 11. April 2018 01:21

Change provider.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04

Re: Rewriting

Postby BobNL » 12. April 2018 20:16

Hoped to find some people who like to tweak together and help each other.

I got it working, by the way. For those who would like to know how, and the questions I still have: https://www.drupal.org/forum/support/post-installation/2018-04-12/questions-about-apache-configuration-htaccess-dns-and.

Sorry for interrupting you. :-)
BobNL
 
Posts: 3
Joined: 09. April 2018 16:33
XAMPP version: ?
Operating System: Shared hosting.

Re: Rewriting

Postby Nobbie » 12. April 2018 21:39

BobNL wrote:Hoped to find some people who like to tweak together and help each other.


I think its a big help i provided. The idea of VirtualHosts is EXACTLY what you try to establish and i never have seen any provider who does suppress VirtualHosts - that is so crazy, that you also can suppress webserver support at all. If you think, it is a good idea to circumvent VirtualHosts by a cumbersome and bulky rewrite: IT IS NOT!

You asked, I answered to the best of my knowledge and belief - why don't you trust me?
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04


Return to Apache

Who is online

Users browsing this forum: No registered users and 14 guests