Jump to content
xisto Community
pasten

Is Wildcards Allowed In Htaccess? Requesting help

Recommended Posts

Can we use wildcards for file names in htaccess? What I mean is whether we can denote a file paths name to something like "/myweb/myfile-*.html" so that we ask the server to process any file with the name "myfile-COMPLETENAME.html"? Still didn't get the point?

Consider a link linking to something like "/folder/". When a link like this is opened it will search for index.html or index.shtml and so on. To override this default behaviour we use the following code in servers .htaccess file:

DirectoryIndex index.html article.html

With this the server first searches for index.html in any folder and if it is not found it then searches for article.html to send it to the browser. Now the problem --> Assume this partial site structure:

/tutorial-1/article-tut1.html/tutorial-2/article-tut2.html/tutorial-3/article-tut3.html...
These folders neither contain index.html nor article.html. But as you see, it has files starting with "article". My question is whether we can use wildcards something like "article-*.html" in DirectoryIndex directive to tell the server to search any file which starts with "article-" with .html extension and display it when somebody opens a link to the folder?

Patiently waiting for reply...
Edited by nitish (see edit history)

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

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.