Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

1
vote
2answers
51 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
15 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
34 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
28 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.
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 ...
1
vote
1answer
33 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 ...
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 ...
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
50 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 ...
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 ...
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 ...
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 ...
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, ...
0
votes
0answers
8 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
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 ...
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 ...
2
votes
1answer
96 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
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
262 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
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 ...
1
vote
0answers
20 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
55 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
59 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 ...
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 ...
0
votes
0answers
21 views

Google Indexing PHP pages with and without backslash [duplicate]

How can we use the .htaccess file to only have our pages indexed by Google without the trailing slash. Right now both pages are being indexed.
1
vote
4answers
77 views

Should error pages be strictly html?

I'm using PHP on Apache server I'm wondering.. If the error pages should best be served as pure and simple html, without database connection etc.? This would remove any chance of ...
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: ...
1
vote
2answers
75 views

htaccess rewrite doesn't work

I'm trying to redirect url's in my /joomla/ folder containing "rsform" to the same url but except for /joomla/ /formulieren/. However my tried .htaccess rewrite doesn't work. I tried: RewriteEngine ...
0
votes
3answers
92 views

.htaccess rewrite problem for domain

I want to use a particular page in my site as any subdomain. I need something like this http://*.site.com/. So, as the user types http://user1.site.com/ or http://user2.site.com/ then the page must ...
4
votes
1answer
49 views

Statically mapping a PHP script to another script using an .htaccess file results in 404 errors

After having read a lot of posts on the topic of URL rewriting, I still remain stuck with 404 status errors. My goal: A 'static' rewrite of URLs, as follows (user clicks or enters the one ...
1
vote
4answers
65 views

Using a .htaccess to RewriteRule and Redirect 301 at the same time?

I have a couple of specific URLs that I want to display differently on my website, like this: RewriteRule ^contact$ contact.php To get ride of the ".php" extension. And to be SEO friendly (to ...
1
vote
1answer
29 views

How can I setup a redirect using an .htaccess that would keep part of the URL path?

I would like to setup a redirect using an .htaccess file which keeps part of the URL's path in the target URL. For example: I have the domain example.com. I want example.com/social to redirect to ...
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 -> ...
3
votes
2answers
54 views

non-cachable Canonical redirect of www to non-www

I know this question is debatable for the whole eternity, and most likely nobody knows the real philosophy of this problem. But I'm trying to solve the problem about 301 and 302 response headers in ...
5
votes
2answers
645 views

How can I disallow access to my website by its IP address?

I want my website to be accessible only by the domain name, not by the server’s IP address. How can I configure Apache to achieve this? Below are the VirtualHost configurations of Apache. ...
1
vote
2answers
75 views

Multilingual website without any index file in the root folder

My client has a very simple website with two different languages and I decided to make a separate folder for each language, for example: domain.com/en/ domain.com/de/ But in the root folder there's ...
0
votes
1answer
143 views

Code for redirecting an HTML page without an extension using an .htaccess file results in a 404 error

I'm trying to redirect an HTML page to a WordPress page which has no extension. The result of redirecting example.com/fa/home.html to example.com/fa/ is a 404 page not found. As you can see they're ...
0
votes
2answers
104 views

How can I remove the .html extension for static webpages that are indexed so they'll still work in a WordPress site?

I have a static HTML website with less than 100 pages and 99 of them are indexed in Google's search engine. I want to convert it into a WordPress website, but there are some problems I'm worried ...
1
vote
1answer
40 views

How can I create a shorter alias URL to a longer URL using an .htaccess file?

Using an .htaccess file, I want to make one specific URL have a shorter alias like this: Original URL: ...
0
votes
1answer
52 views

Google can no longer fetch pages after successful URL rewrites using an .htaccess file

I tried to rewrite my URLs so they no longer have the .html extension. But when I did this (successfully) Google can no longer crawl my pages when I use "Fetch as Google". Instead, it returns 404 ...
1
vote
1answer
241 views

301 redirection removes UTM tags from URLs

A page redirects to another page using a 301 redirect in a .htaccess file. If try to access the page from a URL with UTM tagging after redirection, it removes all UTM tagging. Is this normal ...
0
votes
1answer
33 views

How to include/install mod_proxy_http.c on JustHost

I'm using a service that requires a URL to be sent to their site so that it can return an HTML snapshot to Googles crawlers. In their .htaccess code it has the line <IfModule mod_proxy_http.c> ...
1
vote
1answer
91 views

RewriteRule to send all URLs with `mod` in them to the `moderator` directory

I have a .htaccess file in the root directory of my project, that contains all the rewrite rules for the site to functions. Most of these rules belong to the mod section of the site, and only two of ...