Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

1
vote
1answer
1k views

How to configure mod_bwlimited through htaccess

The mod_bwlimited module in htaccess apparently displays an error if bandwidth is exceeded. Anyone know what options are available for configuring it through htaccess?
-2
votes
0answers
10 views

htaccess only allow google bing yandex traffic [on hold]

I have a problem. website censorship applied to my country. To prevent blocking websites on this subject, an idea came to my mind. I have done it before someone but do not know how he did it. An ...
0
votes
0answers
9 views

Preventing SQL attacks [on hold]

I monitor the domlogs on my accounts looking for unusual POST activity. If I find bad behavior that becomes regular from the same IP address, I add it or the subnet to the IP deny list. I see many ...
0
votes
1answer
77 views

Is it a good practice to block spam bots by IP ranges?

I'm getting too many hits on my website from Yandex. It doesn't obey robots.txt and by some way it can bypass .htaccess rules. So I'm thinking to block all Yandex IP ranges in my system firewall. Is ...
1
vote
1answer
44 views

Internal Server Error 500 .htaccess

For years, I have been using the following .htaccess for PHP to execute within HTML on Apache at GoDaddy: AddHandler fcgid-script .html FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .html A few days ...
2
votes
1answer
21 views

.htaccess not passing GET parameters

I have a .htaccess file that looks like this: RewriteEngine on RewriteRule ^login$ /login.php? [L,R=301] However when I do any get parameters such as /login?random=get&params=true they don't ...
0
votes
1answer
25 views

In CakePhP what is the recommended method for having one sub-domain that's outside the CakePhP environment?

I have a CentOS VPS with LAMP installed. I set up CakePhP and I have my httpd.conf set up with 1 virtual host which points to my CakePhP directory. I have various sub-domains in my CakePhP ...
0
votes
0answers
24 views

My Website is getting a lot of traffic from an unresolved IP address [closed]

My website is getting lot of traffic from an unresolved IP. I am using AWStats and it is showing that I am getting huge amount of hits within few seconds. My hosting company suspended my website ...
1
vote
1answer
86 views

htaccess sitemap.xml rewrite to /sitemaps/$_SERVER[“MYVAR”]/sitemap.xml

I am trying to update htaccess to write as following: htaccess sitemap.xml rewrite to /sitemaps/$_SERVER["MYVAR"]/sitemap.xml This rewrite should only occur if sitemap.xml is requested in root ...
1
vote
1answer
31 views

Restrict access to certain files but not when linked from my own website

I got a problem regarding setting my server settings so that my files can't be accessed from people linking directly to the files, but can when they click a link on my website to open the file. I ...
4
votes
2answers
58 views

Create redirect from url like www.example.us/?p=100&option=

I am switching CMS and have about 600 URLs that need to get redirected to the new scheme. The URL on the old site looks like the following on my test server: ...
0
votes
5answers
110 views

.htaccess is gone after uploading

My htaccess file is gone after uploading. I see it there for a minute or then it's gone. Even cPanel File Manager shows the same thing. Any idea how to fix it? The web host says the problem is on ...
0
votes
0answers
34 views

Sub-Domain Redirect Loop .htacess

OK so i am getting a redirect loop on subdomains only and i dont see the whats creating the loop This is a WordPress Multi-Site sub-domain installation and All plugins are disabled everything on the ...
1
vote
1answer
48 views

Apache htaccess - modify query string with mod_rewrite

I've recently changed scripting on my website, and this has resulted in a few 404 errors as some very old queries are no longer being redirected correctly. I've been trying to create a rewrite rule ...
1
vote
4answers
10k views

How do I do URL re-writes on Plesk?

I am very new to URL re-writing and I am using Plesk which is window-based web server, hence I can't use Apache's mod_Rewrite. Can anyone tell me what is the proper procedure for this?
3
votes
1answer
154 views

.htaccess redirect not working for web alias

I have two domains at one.com: example.com and example.de I would like to redirect from example.com to example.de/en I wanted to use an A record so that example.com points to example.de and then use ...
2
votes
2answers
403 views

Require domain alias to show in browser address bar

Similar to question posted here (but not related to sub directories): .htaccess redirect of domain name alias to main domain but must show up as the alias domain I am trying to direct traffic from an ...
0
votes
0answers
25 views

Friendly URLs with .htaccess

I'm have the following .htaccess: RewriteEngine on RewriteCond %{request_filename} -f RewriteRule ^(.*) $1 [L] RewriteRule ^(([^/]*)+)(/([^/]{0,32})(/.+)?)?$ index.php?a=$1&q=$3 [L] My ...
1
vote
1answer
345 views

Remove fb_action_ids of the URL with .htaccess

For some reason my host not let me have more than one htaccess so I have to make all the changes from the htaccess located in the root. My directory tree is as follows: ..../ ....index.html ....css ...
0
votes
1answer
32 views

How to use htaccess to redirect from www to non-www version of the site [duplicate]

I have a wordpress website mywebsite.net on the wwww version www.mywebsite.net wordpress doesn't load so want that if the user open the www version of my website is redirect to the non-wwww ...
1
vote
2answers
168 views

How do I Add Expires headers for CSS file with ?ver=4.1

I'm optimizing my website with Gtmetrix and in Add Expires headers section it shows the below error- There are 49 static components without a far-future expiration date. ...
2
votes
1answer
116 views

Apache: keep track of non-404 errors (e.g., 403, 500, et al)

In cpanel I always have the error log open ("This function will display the last 300 errors for your site.") which is nice for 404's but what about the rest? I'm working on a few things in htaccess, ...
1
vote
1answer
42 views

How to keep friendly URLs consistent?

I downloaded a site with a crawler script (HTTrack) and now have a few hundred HTML files that need to be edited and re-deployed. The original site ran on a combination of Drupal and a lesser known, ...
0
votes
0answers
11 views

How do I hide the install folder [webroot] while using a subdomain?

Wanted to try out a web install of Owncloud. For some reason or another Owncloud has a hard time masking its own install folder (the webroot) when using a subdomain defined via an A record and picked ...
0
votes
1answer
33 views

http-basic auth, else placeholder-page

Is it possible to show a http-basic-auth, and when someone fails that test, show a certain HTML-placeholder-page? If so, how can I achieve that?
1
vote
1answer
78 views

“Friendly URLs” rule in .htaccess interfering with some directories

My .htaccess is set up to remove .html from URLs as follows: RewriteEngine on RewriteCond %{http_host} ^example.com [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,NC] RewriteCond ...
1
vote
1answer
77 views

Rewrite url /powers/power.php?power=

I want to rewrite my url, the url uses a variable I think its called, but I want to shorten the url to http://xatwebs.co/powers/gold as it is currently http://xatwebs.co/powers/power?power=gold I have ...
1
vote
4answers
177 views

How can I rewrite a subdomain to go to a specific file in a specific folder?

I've done searching for my answer and have tested a few solutions, but nothing has worked so far. I'm trying to get a URL like this http://baseball.sports.com to rewrite to ...
0
votes
1answer
67 views

How can I get a regular expression to only match an empty string? (In a .htaccess file)

I try to make a regular expression in a .htaccess file, that matches only an empty string. I have tried many things, but it seems like it’s impossible. For example, I tried ^$, but it's looking for ...
3
votes
2answers
63 views

503 status fails to load images or CSS

I have the following 503 status set: RedirectMatch 503 ^/(?!index\.html) ErrorDocument 503 /index.html Header always set Retry-After "604800" I understand that this rule tells any robots that the ...
1
vote
1answer
27 views

Moving site - make all links 301 on same tld

Customer had website in Joomla like this: www.example.com/home/ www.domainA.com/home/aboutus www.domainA.com/home/blog Not sure why it was made this way with /home as default. Anyway I moved the ...
0
votes
2answers
88 views

Why doesn't htaccess redirect domain alias to a specific url?

I have this which i can't get to work RewriteEngine On RewriteCond %{HTTP_HOST} ^domainalias.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.domainalias\.com$ RewriteRule ^(.*)$ ...
3
votes
2answers
39 views

htaccess redirect subfolder to root

In the following scenario, example.com is my homepage. I need to: redirect www to non-www redirect index.html to homepage redirect example.com/store to example.com This is my htaccess code # ...
0
votes
1answer
86 views

.htaccess rewrite but keep basic URL

I have basic domain, for example, domain1.com. Also I have domain2.com which is addon domain, and I want to redirect domain2.com to domain.com?parameter=value, which is basically domain1.com, but with ...
1
vote
2answers
32 views

Apache .htaccess - All URLs with different parameters to ONE redirect

I need some help with .htaccess redirect. http://www.example.de/test-music.html?p1=1&p2[test]=23 http://www.example.de/test-music.html?p1=6&p2[test3]=5 ALL of them need to be redirected to ...
1
vote
1answer
37 views

Getting 406 on IE after google redirects my site

I have a wordpress blog. When I search the posts from my site in google, the results appear and on clicking the result I can open that particular post on my site. But while doing the same on Internet ...
2
votes
2answers
51 views

Prevent my hosting server from adding a JavaScript snippet to my page?

My host adds JavaScript in particular cases. I want to prevent that. Maybe through .htaccess? The added code is the following So, even preventing their PHP from executing would be useful.
1
vote
1answer
30 views

Link re-interpreted by browser does not work

I have a problem with links generated by php, for example this link works: ...
4
votes
2answers
2k views

Can I enable GZIP on Godaddy?

One of my sites lives on GoDaddy's bottom-of-the-line cheap hosting, I have the correct code in my .htaccess file, but it's not compressing because mod_deflate is not loaded. How do I enable that? ...
0
votes
1answer
40 views

Block Shellshock/Bashdoor with htaccess?

How do I block Shellshock, also known as Bashdoor, in htaccess? Using a Shared Host, add a Block for User-Agent: "uname" Host: 46.105.126.165 Http Code:/?x=() Date: Jun 26 07:38:49 Http Version: ...
2
votes
1answer
397 views

Permanent redirections after changing the product links structure on Prestashop

I'm looking at changing the products URLs' structure on a Prestashop (v1.5) website. This process is quite straight-forward and it can be done instantly through the corresponding admin panel. The ...
1
vote
1answer
68 views

Efficient use of 301 for large redirect map

EDIT: As requested below, this is the entire ruleset for one product (obsolete now, as I should be able to consolidate these into ONE simple rule that looks for the productID#): RewriteRule ...
0
votes
2answers
24 views

What is blocking some visitors in htaccess?

How do I figure-out what is blocking some visitors in htaccess when it's NOT the IP range, User-Agent, Referer nor anti-hotlinking? Forbid empty Referer & all other domains from hotlinking to ...
0
votes
1answer
46 views

Improving .htaccess 301 redirect for keeping SEO values on large WordPress blog

I have a client with a self hosted WordPress blog with 5000+ posts dating back several years that I'm creating a new template for. When the site is done, it will be moved to a new domain and the old ...
2
votes
1answer
41 views

Why can't I redirect www to non-www on my addon domain?

I have a domain example.com in which I'm doing this to redirect all my traffic from www version to non-www: RewriteEngine On RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC] RewriteRule ^(.*)$ http://%1/$1 ...
0
votes
1answer
27 views

How do I block a UserAgent that is only Mozilla?

How do I block a UserAgent that is only Mozilla? URL: 64.79.100.26.webcrawler.link This does NOT work: RewriteCond %{HTTP_USER_AGENT} Mozilla;\)$ [NC,OR] IP Range was blocked, but I want to block ...
0
votes
1answer
31 views

MediaWiki configuration - strange redirect behaviour after form POST

I've recently setup a wiki using MediaWiki but am having the toughest time getting the ShortURL configuration working properly (for example, so that pages appear as Main_Page instead of ...
1
vote
1answer
49 views

Subdomain htaccess rules

I have the following .htaccess in my root: DirectoryIndex index.html index.php Options +Indexes # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ...
0
votes
0answers
19 views

URL Dynamically changes after first edit

We are developing a magento eCommerce website with main category pages, sub-category pages and details page along with other static pages. Our condition is if any miss-spelled URLs entered directly ...
0
votes
1answer
13 views

Testing server indexed in Google [duplicate]

Assume our website domain to be www.example.com. And we have created a separate testing environment within our main domain: Say : www.project.example.com. So we have two versions within our main ...