Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

0
votes
2answers
32 views

How to change my id and name in php url

How would I change the URL from from: example.com/games.php?id=27 to: website.com/games/271/game-name-here So far I have this in .htaccess: RewriteEngine on RewriteRule ^games/([0-9]+)/?$ ...
0
votes
0answers
9 views

HTTP to HTTPS Redirect, but make it cacheable redirect? [duplicate]

In an effort to speed up my small wordpress site. This was recommended to allow caching my redirects. Wordpress Settings has HTTPS for address. What are my options? Avoid landing page redirects ...
0
votes
1answer
46 views

.htaccess 301 Redirect [duplicate]

How do I make it so all traffic is directed for the entire site and all subdirectories from non-www to www Here is my .htaccess contents: RewriteEngine on <IfModule mod_suphp.c> ...
3
votes
2answers
190 views

My .htaccess entry is not working

The below are all my .htaccess entry: RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.acethehimalaya\.com$ [NC] RewriteRule (.*) http://www.acethehimalaya.com/$1 [R=301,L] redirect 301 ...
0
votes
1answer
97 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 ...
2
votes
1answer
55 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
75 views

.htaccess file not caching

I have read several guides for how to write the htaccess file for caching but with no success. I asume I wrote something wrong and need some help on finding what i did wrong. Here's my htaccess file: ...
3
votes
2answers
63 views

Redirect non-www to www : .htaccess without giving the domain name

To redirect non-www to www we often see this in .htaccess: RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.example\.com [NC] RewriteRule ^(.*) http://www.example.com/%{REQUEST_URI} ...
1
vote
1answer
23 views

Apache .htaccess mod_rewrite: use of [NC]

I see tons of .htacces examples containing the [NC] flag (NoCase = case-insensitive) For example the famous h5bp page use the [NC] flag a lot: ...
0
votes
1answer
44 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 ...
1
vote
1answer
24 views

How to do 301 redirect for complete URL?

I have a lot of URL, which can't be redirected, or, better, rewrited with mod_rewrite in .htaccess, so instead rewriting, I have created 301 redirects manually. It isn't too much records, about 40 ...
0
votes
0answers
23 views

Hosting htaccess redirect subdirectory to subdomain

I have simple hosting plan with domains included: Now I have the domain.com and seconddomain.com now I want to use all that domain and give them his own root directory. If I use the controle panel ...
1
vote
1answer
118 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
0answers
17 views

Why does Apache parse .htaccess if accessed through the main page and not through a VirtualHost?

I have two websites. One is hosted on /var/www (www.example.com) and the other is /var/www/test (test.example.com). The second is a VirtualHost. I wrote a .htaccess (I'm using it to mod_rewrite), put ...
1
vote
1answer
41 views

Having Difficulty Blocking Spam Website Visitors

I'm getting hammered by spam requests. I allow guest comments that require pending and got over 20,000 of them in a very short space of time. 99% are from Ukraine or China. To bypass this I have used ...
1
vote
1answer
68 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 ...
0
votes
1answer
24 views

Difference between redirect and rewrite in .htaccess (in relation to SEO and the canonical tag)

Okay so if I'm wanting to remove the extension of a URL but my canonical tags point to the url with the extension I can't use a 301 redirect without it negatively affecting SEO. Does the same go for ...
0
votes
1answer
33 views

Vanity URLs with .htaccess and PHP?

I need to create a vanity URL redirect using htaccess and PHP. My requirements are: If a user writes example.com/users/foobar The client will be redirected to for example: profile.php?user=foobar in ...
0
votes
1answer
21 views

Leverage browser caching for WordPress images on media subdomain?

My website is built with WordPress and I'm using a combination of the plugins W3 Total Cache and Autoptimize to make my website faster. My settings seems to be correct and most optimisation efforts ...
3
votes
1answer
183 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
432 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 ...
1
vote
1answer
367 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 ...
1
vote
0answers
28 views

Parallels Plesk Apache dedicated server shared IP / A Address serving default page

My Website Works when you go to it, however Google Adwords is telling me that my site is redirecting/ not showing up properly to their bots. When you put the site into a website checker like GT ...
1
vote
2answers
214 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. ...
0
votes
1answer
13 views

Disable directory indexing for all directories using root htaccess

How to disable directory indexing for all directories using root htaccess? Using this line Options -Indexes only disable listing on directory where the htaccess put. I'm sure there's a lot of ...
1
vote
1answer
64 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 ...
1
vote
1answer
84 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
84 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
1answer
44 views

Wordpress https://example.com not redirecting to https://www.example.com htaccess

I'm using WordPress and moved to https recently. I've had some issues since with the domain not redirecting properly. Currently it works OK but https://example.com is not redirecting to ...
3
votes
2answers
118 views

redirect 204 with htaccess if url contain certain string

I get tons of url with "undefined" added at the end of url, consisting about 20% of my pageview. I tried to check the troubling script source and can't find it. Tried some solutions but none of them ...
0
votes
1answer
85 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 ...
0
votes
0answers
52 views

redirecting bots and crawlers to another but not human via htaccess

I would to apply this diagram via htaccess I tried a lots of codes but I failed every time so I need to redirecting bots and crawlers especially from facebook via htaccess regards
0
votes
2answers
113 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 ^(.*)$ ...
0
votes
1answer
100 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
3answers
52 views

htaccess , htpasswd and error 401

I have a problem with htpasswd. I get an error in error.log apache2 user admin: authentication failure for "/": Password Mismatch Content of my htaccess file: # Set Access Restrictions ...
1
vote
1answer
40 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
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
1answer
33 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 ...
4
votes
2answers
70 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
112 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
38 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
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?
0
votes
0answers
27 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 ...
0
votes
1answer
38 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 ...
2
votes
1answer
119 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
43 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
13 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
38 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
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 ...
3
votes
2answers
93 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 ...