Note that there are some explanatory texts on larger screens.

plurals
  1. POmerging two folder with mod-rewrite in .htaccess
    primarykey
    data
    text
    <p>I'm currently developing a drupal based website but will have to keep a legacy system and many static pages/folders alive. It would be great if i could keep the old rubble in a separate folder than the new site. This would mean I've to merge both folders on the fly. I thought that this folder structure would be great. </p> <pre><code>/htdocs/legacy (symlink to old web root) /htdocs/index.php /htdocs/.htaccess /htdocs/other drupal files and folders /htdocs/... </code></pre> <p>This would mean that if i.e. mydomain.com/xyz.php is accessed the server should try to serve it in the following order.</p> <ol> <li>if file or folder in /htdocs/ server this</li> <li>if file or folder in /legacy/ serve this but do not rewrite the browsers location bar.</li> <li>else rewrite pass it as querystring to the </li> </ol> <p>I came up with the following rewrite rules. Which however don't work. I can either serve files in legacy or via drupal. </p> <pre><code># 1. server from .htaccess folder RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.*)$ - [NC,L] # 2. serve from legacy RewriteCond /full-path-to-legacy-folder/%{REQUEST_URI} -f [OR] RewriteCond /full-path-to-legacy-folder/%{REQUEST_URI} -d RewriteRule ^(.*)$ /legacy/$1 [NC,L] # 3. else RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] </code></pre> <p>Has anyone of you suggestions? </p> <p>Many thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload