Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

0
votes
0answers
11 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
21 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 ...
3
votes
1answer
191 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
votes
0answers
16 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
2answers
215 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
229 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
139 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 ...
2
votes
1answer
48 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
201 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 ...
1
vote
1answer
39 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
2k 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
20 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
61 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 ...
0
votes
0answers
14 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
41 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
40 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
372 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?
0
votes
2answers
115 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 ...
1
vote
1answer
35 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
52 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 ...
2
votes
2answers
270 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 ...
5
votes
3answers
18k 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
824 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 ...
0
votes
0answers
8 views

Multisite permalinks for subfolder wordpress installation [migrated]

I have WordPress installed in a subfolder of the main site: http://www.example.com/blog/ Now I need to add second blog on http://www.example.com/blog/second/ So 2 blogs should work on the following ...
0
votes
4answers
36 views

Problem getting rewrite from subdomain to directory to work

I want to redirect demo.example.com to example.com/my-demo. This is my rewrite rule, but I'm not getting it to work on my production server: RewriteCond %{HTTP_HOST} ^demo\.example\.com ...
0
votes
0answers
19 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
1answer
40 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
70 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:- ...
3
votes
2answers
46 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 ...
1
vote
2answers
48 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 ...
1
vote
4answers
76 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 ...
3
votes
1answer
695 views

What are the most commonly used and basic Apache htaccess redirects?

This question is here so we can offer users who are looking for information on how to make one or more common or basic redirects in Apache using the htaccess file. All future questions pertaining to ...
1
vote
1answer
142 views

Can't get Rewrite rule to keep original URL

I have these Rewrites, but I would like to have the URL stay the same as what is typed originally, I thought removing the [R] flags would stop it but it hasn't RewriteCond %{HTTP_HOST} ...
0
votes
3answers
93 views

Using a front controller design pattern doesn't allow images to be served

I am currently using a front controller. All requests for my website go through it. I have a problem with image links like: <img src="img/image.jpg" /> Then my front controller will try to ...
1
vote
1answer
61 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
90 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 ...
2
votes
2answers
116 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 ...
4
votes
1answer
40 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
49 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
28 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
37 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: ...
1
vote
1answer
143 views

Masking / mapping URL's with .htaccess

I've recently been trying to come up with a way of masking the visible URL in the browser (so not 301 redirecting) and still show the same content as the original URL. Here is the scenario... ...
1
vote
2answers
53 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 ...
5
votes
2answers
637 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. ...
0
votes
2answers
80 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 ...
0
votes
1answer
85 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
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 ...
0
votes
1answer
56 views

301 redirect to the new website but without apostrophes in the URL

I am trying to 301 a page that has a ' in the URL and regular redirect 301 doesn't work. Is there a way to match part of the URL until the ' and use that to 301 to a new page? Example URLs are below: ...
0
votes
1answer
29 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> ...