Quantcast
Channel: Apache URL rewrite does not mask subdirectories - Webmasters Stack Exchange
Viewing all articles
Browse latest Browse all 2

Answer by Vicky for Apache URL rewrite does not mask subdirectories

$
0
0

If you don't have access to the main .htaccess file in the document root (docroot) of your website and want to set up a specific rewrite rule for the /resources URL path to point to /sites/default/files/resources/index.html, you can create a separate .htaccess file in the /sites/default/files/resources/ directory. In this directory's .htaccess file, you can add the following rules:

Create or edit the .htaccess file in the /sites/default/files/resources/ directory.

Add the following directives to that .htaccess file:

RewriteEngine OnRewriteBase /resources/# Redirect /resources to /sites/default/files/resources/index.htmlRewriteRule ^$ /sites/default/files/resources/index.html [L]# Handle other resources if needed (e.g., images, CSS, JavaScript)# Add rules for your specific needs here

These rules will redirect requests to /resources to /sites/default/files/resources/index.html. You can also add additional rules to handle other resources like images, CSS, and JavaScript files if needed.


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>