All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
1 answer
524 views

Redirect to folder only if root from other site referrer

I have a redirect from root to subfolder. If user visits https://example.com it redirects to https://example.com/subfolder. But I want it not to redirect if referrer is my site, so user can reach root ...
Stas Ponomaryov's user avatar
1 vote
2 answers
588 views

Giving a single sub directory multiple names via htaccess

Primary Scenario ( Answer Needed ) If my website http://website.com has multiple subdirectories: /features/ . /articles/ . /projects/ Which all contain their any number of files and folders; Is ...
W. Eless's user avatar
0 votes
0 answers
59 views

redirecting domain to subfolder with .htaccess

I'm new to using and changing the workings of a server and all that. So far I've only had one server with one domain for myself, but now a business is getting some traction and I want to use a ...
Malte's user avatar
  • 1
0 votes
2 answers
689 views

.htaccess password protect a file in a certain directory

I have files with the same name in different directories on the serves (example: stats.php), and I want to password protect some of them (.htaccess file in the root directory). I tried "FilesMatch" ...
Mike's user avatar
  • 143
1 vote
1 answer
676 views

Apache Reverse Proxy | Wildcard directory rerouting (.htaccess)

How would it be possible to have a wildcard directory proxy? I have gotten the basics but the issue is, it gives out the directory which I'm in, my htaccess file: RewriteEngine on RewriteCond %{...
George Tsatsis's user avatar
1 vote
0 answers
11 views

Laravel project in subfolder of public_html gives trouble with .htaccess redirect [duplicate]

I've set up my VPS server and am trying to set up a Laravel project. I have a /public_html/ folder with an index.html that's shown when visiting the website URL. I have a laravel project in: /...
mesqueeb's user avatar
  • 111
0 votes
1 answer
2k views

Apache Aliased Directory doesn't work for child directories of alias

I'm trying to run two different applications under user. Application 1: /home/user/public_html/app/public/ Application 2: /home/user/public_html/forum/ VirtualHost has the Server set to the ...
acupofjose's user avatar
0 votes
1 answer
45 views

Protect a directory if remote host is/is not

How can I protect a directory within .htaccess only if the remote host is not 192.168.1.11 ? Below is how I actually protect directories: AuthUserFile /home/personal/.htpasswd AuthName "Auth Area" ...
Mattia Merlini's user avatar
1 vote
1 answer
203 views

Specify which directores to look for .htaccess file

I'd read that enabling .htaccess for all directories causes a performance overhead, because all subfolders are also scanned for .htaccess files. I'd like to only have the .htaccess file read in: /var/...
gijs007's user avatar
  • 117
2 votes
1 answer
3k views

Apache: ExpiresByType per directory?

I have a folder with javascript files that should expire faster than the normal scripts. Is it possible to let files expire per directory using Apache 2 other than .htaccess? <IfModule ...
Martin's user avatar
  • 220
0 votes
1 answer
1k views

Looking to generate a directory exception to .htpasswd SSL-protected site

I have an entire site under .htpasswd with SSL - any http requests are rejected - and am trying to exempt a folder from the rule. Either to do a basic .htpasswd for the directory, or make it open. I'm ...
Hugh's user avatar
  • 1
1 vote
1 answer
1k views

500 Error when using Apache Directory Directive

I am trying to restrict access to certain directories to certain IP's.... I have done some research & the below is what I came up with, however it returns a 500 internal server error when I try &...
Brett's user avatar
  • 319
1 vote
0 answers
682 views

htaccess, mod_rewrite, remove part from URL

I want to access domain.com/api/(.*) instead of domain.com/public/api/(.*) Directory structure: domain.com __folder1 __folder2 __public ____api ______.htaccess2 ____afolder1 ____afolder2 ____index....
danielpopa's user avatar
0 votes
1 answer
419 views

Put website into a folder, don't show folder on URL, and still have access to other folders

I'm trying to host my website into a folder on the FTP, for example, /site. But on the URL i want to remove this folder, so it will be www.mysite.com.br instead of www.mysite.com.br/site. I've ...
Eduardo's user avatar
1 vote
1 answer
80 views

Linking domain name to subdirectory without displaying subdirectory name in address

I've got a domain name, blogdomain.com, which I've linked to otherdomain.com/blog using this .htaccess file: RewriteEngine On RewriteCond %{HTTP_HOST} ^(www.)?blogdomain.com$ RewriteRule ^(/)?$ blog [...
lowercasename's user avatar
0 votes
1 answer
226 views

htaccess url rewriting for 1 folder

My .htaccess file works fine for everything expect 1 specific folder. As result, http://www.mydomain.com/administration/index.php unexpectedly goes to 401 error page instead of loading index.php from ...
Haradzieniec's user avatar
1 vote
1 answer
686 views

Wordpress htaccess redirect destroys my non-www to www redirect

In my root domain I have an .htaccess to redirect non-www to the www, and to redirect to a subdirectory (containing a temporary website). This is done using the following code: Options +...
Lode's user avatar
  • 178
1 vote
2 answers
4k views

Change the document root of a parked domain?

I have run into a problem which is that my web host doesn't appear offer addon domains. I currently have a domain name pointing to my name servers. I went into cPanel to add an addon domain that ...
user77996's user avatar
  • 113
0 votes
3 answers
9k views

How to allow only specific directories to use htaccess?

Currently in apache2.conf I have AllowOverride all set for /var/www which simply allows htaccess for all the sites on the server (which is Ubuntu, 9.04). However, I'd rather only allow overrides in ...
DisgruntledGoat's user avatar
0 votes
1 answer
145 views

How to get file directory trough .htaccess by using `RewriteRule ^(.*)$ ?id=$1 [L,QSA]`?

How to get file directory trough .htaccess by using RewriteRule ^(.*)$ ?id=$1 [L,QSA]? If .htaccess is located in http://localhost/some/dir/.htaccess and I'm opening http://localhost/some/dir/here/I/...
Binyamin's user avatar
  • 133
2 votes
2 answers
2k views

Apache 2 .htaccess matching all sub directories of current directory

I want to disable the php engine in all directories below the current one. I have tried using <Directory> and <DirectoryMatch> but cannot find the correct regex syntax for matching just ...
user56990's user avatar
1 vote
1 answer
988 views

How to redirect a subdomain with subfolders to a domain using the same subfolders and the subdomain itself as parameter?

So I would likte to redirect this url: http://subdomain.domain.com/subfolder/subsubfolder/ to: http://www.domain.com/subfolder/subsubfolder/?parameter=subdomain And also using other, more, less or ...
Diederik's user avatar
  • 111
0 votes
2 answers
330 views

.htaccess directory nightmare

I'm on a shell, and my web folder is located at /home/w/waterfox/public_html. In there, I have a directory called irclogs, which I'm trying to password-protect. It is chmodded to 755. Here is the ....
Kudu's user avatar
  • 257
1 vote
2 answers
468 views

Same index for all (sub-)directories?

I was wondering if it was possible to write some .htaccess page that makes the server use an index.php file in a SINGLE directory as the index file for every directory/sub-directory on my server, ...
user avatar
0 votes
2 answers
1k views

How do you redirect pages from a directory to a subdirectory?

I had recently moved all the content on my website from being in the www.mysite.com/shop directory to being in the root directory. This means that I needed to redirect any request to visit a page with ...
user43652's user avatar
1 vote
1 answer
405 views

Apache outputs all urls of a second domain as a subfolder of the primary domain name

Would anyone be able to possibly give me some guidance? Basically, I have a 'shared hosting' account with a large internet hosting provider, and my account lets me have multiple separate domains ...
Steve Rathbone's user avatar
2 votes
3 answers
8k views

Preventing access to files if a user types the full url on the address bar

i have a website, some folders on the websites contains images and files like .pdf , .doc and .docx . the user can easly just type the address in the url to get the file or display the photo http://...
bogha's user avatar
  • 235