Hot answers tagged

3

RewriteCond %{REQUEST_URI} !^/Joomla3 RewriteRule ^(.*)$ Joomla3/$1 [L] What these directives do is... if the requested URL does not start "/Joomla3" then internally rewrite the request to the "Joomla3" folder. What you need to do is add another condition to state that... if the requested URL does not start "/Joomla3" and it does not start "/owncloud" ...


2

A site doesn't have to have a .htaccess file. If you don't have a .htaccess file, your site will run on the settings in the apache and PHP server configuration files. Having your file named .htacces.txt (or .htaccess.bak for that matter) will not have any effect on your server, it won't refer to the file for any settings. If you then rename your file to ...


2

Firstly if the file is named htaccess.txt then that means the htaccess file is not enabled as only the file named .htaccess will work. Secondly if you are getting a 500 error when you enable the .htaccess file you either have an error in your htaccess syntax or overrides are not supported. You would need to check the error logs to see which one it is. Some ...


1

DirectoryIndex test.html is not ordinarily done in .htaccess. In order for it to work in .htaccess, you will need AllowOverride All (or something similar) within your sites .conf file. Ordinarily, DirectoryIndex test.html is placed in the sites .conf file. This is the best place for this directive. Where you find your .conf files all depends upon your ...


1

The only way to be sure why you are receiving a 403 error is to check the logs. They will tell you the reason why it is forbidden. The DirectoryIndex itself doesn't create any new rule that would provide a 403 error. However, if the error began after you made that change, you likely have Options -Indexes, or a similar line, which gives a 403 message rather ...


1

What you are referring to is a "front controller". The usual first step is to make sure that the resource being requested is not a physical file on the filesystem before rewriting to your front controller (ie. your Perl script). For example, using mod_rewrite in your root .htaccess file: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{...


1

RewriteRule portfolio portfolio.php RewriteRule reportage reportage.php Sorry, just realised what's going on... you need to be more specific in your rewrites. The above rules will rewrite the URL if "portfolio" (or "reportage") appear anywhere in the requested URL - this will catch your image URLs as well (since "portfolio" and "reportage" are part of ...


1

RewriteRule ^$ /temp [L] If you have a physical directory temp in the root of your filesystem... and since you have omitted the slash from the end of the RewriteRule substitution then mod_dir will attempt to "fix" the request by appending a slash. It does this by issueing a 301 redirect. (You are then presumably relying on the DirectoryIndex to serve the ...


1

ANSWERS: My web host made changes, activating "DirectoryIndex". Yes. Just add "Options -Indexes" to .htaccess file. No. SHORT EXPLANATION: This is an apache functionality called "DirectoryIndex". If this is activated, when: a directory url is requested (e.g. www.example.com/assets/); and no index file exists, the apache server creates an index file ...


1

Maybe try something like this: RewriteCond %{HTTP_HOST} !^oldsite.com$ RewriteRule ^/?unchanged/url - [L,QSA] RewriteCond %{HTTP_HOST} !^(www\.)?newsite.com$ RewriteRule ^(/?specific/page) http://newsite.com/$1 [R=301,L] RewriteCond %{HTTP_HOST} !^(www\.)?newsite.com$ RewriteRule ^ http://newsite.com/ [R=301,L] The order is the important part. First, ...


1

I suggest you add [R=301,L] after your RewriteRule in your .htaccess to redirect the visitor, like so: RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] Currently your telling the browser "There is a https version I want you to visit". The R=301 adds "I want you to go there via a 301 reload". It's the reload part you don't have in place ...


1

How does google determine these pages are compromised if there are no malicious code can be found from both my browser or google's "fetch as google"? Google may be using a separate IP address that is not the same as that used when the "fetch as google" operation is performed. For example, someone actually working at google might be randomly manually ...


1

You can do this without using .htaccess at all. What you need to do is define a wildcard DNS record directing all queries on the subdomains to your application server. The using whatever language you are developing in you would check the host header (fully qualified domain name) to identify the user being requested. Then as part of your application code if ...


1

The easiest way to do this isn't with rewrite rules but with the redirect directive. Simply use Redirect 301 /oldfile.htm http://example.net/newfile.htm in your .htaccess file to redirect a single file from the current site to a file on another domain.



Only top voted, non community-wiki answers of a minimum length are eligible