Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

1
vote
2answers
42 views

How to display “Not Found” instead of automatic redirecting?

how to redirect to 404 in .htaccess file ? Example www.domain.com/ja/any_post or www.domain.com/ja/all_posts www.domain.com/fr/any_post or www.domain.com/fr/all_posts A little bit more ...
0
votes
0answers
13 views

htaccess specify php location

I'm using shared hosting, can create .htaccess and php.ini and have access to ssh. I have PHP 5.6 installed to ~/public_html/php56 and can use this path with ssh, cron and exec() but not on the web. ...
1
vote
1answer
32 views

htaccess RewriteRule: Premature ending of rewrite iteration?

I'm still trying to grasp the concept of Apache's RewriteRule, so please confirm if my understanding of the below is correct... So, here's a snippet of a website's .htaccess, I add numbers in front ...
1
vote
1answer
25 views

Rewrite root folders to a php file and exclude some folders

I want to rewrite all the root folders to mysite.com/index.php?folder=^folder using Apache htaccess. However, I don't want the images folder to be rewritten. Like Facebook.
3
votes
1answer
210 views

Site migration and SEO impact

I'd greatly appreciate a response on the following question relating to site migration and SEO impact. Here's some background on how my domain name and site is currently configured: My domain name ...
1
vote
1answer
39 views

redirect the site IP address to the domain name

I am attempting to redirect the IP address of my domain to the domain name and am running into trouble. The IP address does not redirect to the domain name listed in the redirect statement below. The ...
2
votes
2answers
249 views

Error 404 after rewrite query strings with htaccess

I'm trying to redirect the URLs of a client's website like this: www.localsite.com/immobile.php?id_immobile=24 In something like this: www.localsite.com/immobile/24.php I'm using this rule in ...
0
votes
1answer
256 views

Is there a “current directory” variable in .htaccess RewriteRule?

In a .htaccess file in the subfolder "/preview" (not in document root), I have this rule: RewriteRule !^public/ /preview/forbidden.php [L,R] It redirects all /preview/"something" requests that are ...
1
vote
2answers
142 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 ...
1
vote
1answer
32 views

.htaccess rewrite rule domain alias doesn't work

I have a site called: www.example.com this is the main domain. Now I have a Alias: www.example2.com. I want that example2.com will be forwarded to a subdomain of the main domain to ...
1
vote
1answer
225 views

htaccess/cPanel 301 redirects not working for add-on domain

I've already looked at many samples and tutorials how to set up those 301 redirects on Apache and can't figure out why some are not working. Whenever I want to redirect any still existing page from ...
0
votes
0answers
15 views

URL rewrite issue with cakephp

I am using cakephp framework 2.2.2 I want to create personalize URL for user if user enter username=pragnesh then they can access my site like http://pragnesh.mylocalhost.com same as in ...
0
votes
0answers
28 views

How can I set the PNG expires headers in a WordPress site?

In my website I have the expires headers settings reported below. When I use Google's PageSpeed Insights test I get the message: XYZ.png expire headers not set, which I'm getting for all the PNG files ...
0
votes
0answers
22 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. That process is quite straight-forward and it can be done instantly through the corresponding admin panel. The ...
1
vote
1answer
12 views

301 htaccess redirect for WordPress tag

I need a 301 redirect for tag pages that have been created, for example: http://www.mydomain.co.uk/tag/endovenous-laser/page/14/?m&pgd=10 It might look something like this I guess, but this did ...
2
votes
2answers
8k views

Redirect/Rewrite Subdomain to Subfolder

I'm trying to redirect a subdomain to a subfolder e.g. forums.domain.com to www.domain.com/forums Note that I started the forums in the subfolder format but worried that members might mistakenly try ...
0
votes
0answers
5 views

How to fire 404 to all non-canonical urls? [migrated]

Could somebody point me to htaccess rules, which would fire the 404 error to any page, which hasn't the canonical tag? I thought about something like this snippet could achieve (not sure, whether it ...
0
votes
3answers
59 views

Always redirecting to https without www

First off all, I have searched and read multiple posts in this form and other websites on this matter and tested everything. Unfortunately the trial and error has not yet payed off. I am OK with ...
1
vote
1answer
431 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?
1
vote
1answer
47 views

Wild card redirection for HTTPS and Non-www version

i want to enable SSL for my main website and sub-domain websites. for SEO reasons i need to redirect HTTP requests to HTTPS requests and i think i should do that using wild card redirect in htaccess ...
0
votes
0answers
7 views

I can't access a subdomain, .htaccess [closed]

I made a subdomain for my website, something lilke test.example.com. In the main folder of the webhost I do not have any .htaccess file, but in the folder "test" I have one. when I access the ...
0
votes
2answers
130 views

Google still has record of my old site URL - what to do?

I had a blog site, i.e. http://example2.com, then I bought a new domain, i.e. http://example.com and 301 permanent redirected example2.com to example.com. But when I get into the Google Webmaster ...
2
votes
2answers
306 views

Using .htaccess, can you hide the true URL?

So I have a web hotel with 1 main website http://www.myrootsite.com/ and a few websites in subdirectories, in a folder called projects. I have domain names pointing to the subdirectories, but ...
1
vote
2answers
21 views

Is it possible to configure a .htaccess file to access example.com/subdomain/ without any redirects?

I need to configure 2 CMS's on a domain. The first is on example.com. The other is on subdomain.example.com. Is it possible to configure a .htaccess file so that the second CMS is accessible as ...
6
votes
3answers
2k views

.htaccess permanent redirect to www

I have a WordPress installation that is not redirecting URLs not starting with www. Example: http://example.com/dir/ doesn't send to http://www.example.com/dir/ instead goes to http://example.com/. ...
1
vote
1answer
52 views

Avoid 301 redirect in cdn.domain.mx

I have a domain with a .htaccess redirection problem. The active CDN the URL should be: cdn.domain.mx/images/test.png but redirects: cdn.domain.mx/images/something.png -> ...
0
votes
1answer
82 views

Showing content from pages at different URL's (masking), possibly with .htaccess

If I have URL's like:- domain.com/category/widgets/filter/blue domain.com/category/widgets/filter/red And it is pretty difficult to reconstruct them to something like:- ...
0
votes
0answers
34 views

htaccess for caching adsense javascript code for better pagespeed score

I'm adsense publisher, i need to improve my pagespeed score. I already got 90/100 for speed and 100/100 for User Experience. it is google adsense code that prevent me from getting 100/100 here's the ...
0
votes
0answers
12 views

RewriteRule not working properly in my ubuntu server 14.04 running in Windows Azure

In my server I kept signup.php and in htaccess I kept this thing - RewriteRule ^/registration/?$ http://www.mydomain.com/signup$1 [R] But this is not redirecting ...
2
votes
1answer
27 views

.htaccess RedirectMatch not working when *some* users include “www.” in URL

I have recently moved a site to a new domain, and at the old domain, I created a .htaccess file that includes one line of code: RedirectMatch 301 ^/(.*) http://newdomain.com/$1 The goal, of course, ...
5
votes
2answers
989 views

Is it better to remove old URL from google via webmaster than 301 rewrite?

I have a site which changed from one shopping cart to another. Previously there was an .htaccess file which redirected all the old URLs to the homepage. I changed it to report a 404 for any URL not ...
1
vote
2answers
55 views

Duplicate content error results instead of a 404 page

My current URL is: www.example.com/category/we-developer/ However, if any user mistakenly adds extra characters after the /, for example, www.example.com/category/we-developer/fgggfgg, it should take ...
0
votes
0answers
3 views

htaccess rewrite containing “rsform” doesn't work [closed]

The guys at ProWebmasters suggested moving this question to stackoverflow so here I am, original question: ...
0
votes
1answer
12 views

Trying to rewrite a URL to an existing URL with htaccess

I have a wordpress site up and it's been up for a while. Recently I was asked to change the URL of one of the pages. The current URL is: http://url.com/blog/category/newsroom They want the URL of ...
0
votes
0answers
25 views

Apache WAMP and .htaccess

I recently installed WAMP and everything is working great, however I git cloned a website I am supposed to work on, and it has a .htaccess on it to allow Slim (PHP framework) to handle the url ...
1
vote
2answers
23 views

Redirecting from a link but allowing the link to still be visited with htaccess

I have three versions of an article on a website. Each one is written a few years after the last and updates the topic to keep it fresh and I want to redirect traffic from the older ones to the newer ...
-1
votes
0answers
18 views

Error Using htaccess

I am using Wordpress site .When We change the permalink to postname the htaccess will be changed so they go to the plain code RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f ...
2
votes
1answer
95 views

Cache control header specified in .htaccess is not working for static files

I'm trying to use Google PageSpeed Insights to speed up my website - www.edmhunters.com. First off, here is what my .htaccess file looks like # ...
1
vote
1answer
40 views

Redirecting HTTPS to HTTP without purchasing another IP address

So in the past I have always bought a new IP when working with SSL certs. I came across a client that is on a shared IP and using a cert for one of the sites but not the others. So domain #1 has cert ...
2
votes
4answers
4k views

How to enable use of .htaccess in Apache on Ubuntu?

I'm trying to enable use of htaccess file in Ubuntu 14.04 (Apache 2.4.7). I know that this question has many possible duplicates, but none of them helped me yet. .htaccess: ErrorDocument 404 ...
1
vote
0answers
32 views

Apache virtual hosts configuration for MAMP results in new sites going to the same folder

I have MAMP installed in my mac. Why is it that every time I create a new site, they all go to the same folder? Here is my /etc/hosts file: 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 ...
0
votes
1answer
240 views

Leveraging browser caching issue

I am triying to obtain a good calification on Page Speed test, now I've obtained 85 points but I am still on the problem of "Leverage browser caching". This is the Page Speed test message about this ...
1
vote
0answers
19 views

Passing Arabic values in parameters results in % spaces

I have built an .htaccess clean URL, this part works perfect in my .htaccess: RewriteCond %{THE_REQUEST} /road.php\s [NC] RewriteRule . نقفورالثانيفوكاس/ [R=301,L] RewriteRule ^نقفورالثانيفوكاس/$ ...
0
votes
2answers
46 views

My website Internal links are no-follow

I have a website and all the link showing no-follow is it good for SEO purpose? or I want to make it do-follow what should I do now? Actually my website is access with two version WWW or without WWW ...
1
vote
2answers
54 views

Redirect Everything After slash (/) to another directory

I'm sure this is an easy thing to do but I can't seem to find the answer! I'm trying to redirect https://carddav.example.com/MYUSERNAME to ...
1
vote
1answer
39 views

Apache Redirect to another folder, both within and outside document root

I've recently set up a home web/media server and having a few difficulties with a few of the settings. It's working fine for serving webpages etc but I've now reorganised the structure of the main ...
1
vote
1answer
57 views

Need help getting 'www' working for domains and subdomains using Apache & DNS

I've searched through a lot of different posts asking this question and I haven't really seen a straight forward answer on how to get this working. At the moment, with the following settings, adding ...
5
votes
3answers
19k views

How to remove trailing slashes from URL with .htaccess?

The situation Across the entire domain, we'd like the URLs to hide file extensions and remove trailing slashes, independent of the domain name itself (as in, works on any domain). Sample of our ...
7
votes
1answer
1k views

.htaccess redirect url without trailing slashes

In my htaccess I have some rewrited urls like these: RewriteRule ^first-page$ /subdir/page.php?id_page=1 [QSA,L] RewriteRule ^second-page$ /subdir/page.php?id_page=2 [QSA,L] RewriteRule ^third-page$ ...
2
votes
1answer
882 views

Remove multiple trailing slashes in a single 301 in .htaccess?

There is a similar question here, but the solution does not work in Apache for our site. I'm trying to remove multiple trailing slashes from URLs on our site. I found some .htaccess code that seems ...