So I am currently using a particular app on apache that is hosted on its own subdomain. In the root directory of this app there is an .htaccess file with the following code
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ /$1/ [L,R=302]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php/$1 [L]
I want to create a symbolic link in the directory to link to a completely different app so requests to subdomain.domain.tld/symboliclink/ would use the symbolic link created in the root directory of the subdomain app. The only problem is the .htaccess file above redirects all requests back to itself. How can I set up the subdirectory symbolic link to ignore this .htaccess file so requests to the symbolic link from the web will correctly route traffic while keeping the .htaccess file above unmodified?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hey there,
You could add this rule above your other rules:
RewriteRule ^(symboliclink)($|/) - [L]
You could also add an .htaccess in the symboliclink location with the following line of code:
RewriteEngine Off
As an example, Apache will go up the folder tree until it finds an applicable .htaccess file. The rules at /var/www/html/folder/.htaccess will override the rules /var/www/html/.htaccess on pages within example.com/folder.
Happy coding,
Jon Schwenn Platform Support Specialist DigitalOcean
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.