Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

1
vote
1answer
15 views

Using htaccess to internally and externally redirect a page at the same time [duplicate]

I've been trying to figure this out for two hours, and I give up. I want to externally redirect about.php to about/, and also have about/ internally redirect to about.php RewriteRule ^about/$ ...
1
vote
1answer
15 views

How can I pass optional URL parameters through my rewrite rule?

I created a CMS that identifies if the GET value of url is defined, and if it is, it returns the html contents of the page from the frontend template on index.php. This ideally is to make a templating ...
1
vote
0answers
66 views

Can Apache .htaccess convert the percent-encoding in encoded URIs from Win-1252 to UTF-8?

I want to add a directive in my .htaccess, such that if the browser is pointed at a URI containing %E4 (ä) - or any other special character - the .htaccess automatically rewrites %E4 (ä) as %C3%A4 ...
1
vote
1answer
24 views

Removing “product.php” in URL using .htaccess

The current URL: http://www.example.com/product.php/sample-product.html. I want change it to: http://www.example.com/sample-product.html
0
votes
2answers
21 views

Remove folder name from rewrited URLs

Consider this URL: http://website.com/gallery/20141111-some-title In this URL I want to hide gallery/: http://website.com/20141111-some-title How can I achieve this using mod_rewrite? I used ...
2
votes
1answer
33 views

Links on Google result list with unnecessary parameters

I have a website that uses .htaccess to turn the parameterized URLs into a folder pattern based URL For example : www.example.com?lang=de&cat=mycategory becomes www.example.com/de/mycategory ...
1
vote
2answers
28 views

Use .htaccess to configure subdomains serve content from folders rather than from the root domain

Here is site http://www.glassnow.com.au/ With 3 subdomains: brisbane.glassnow.com.au goldcoast.glassnow.com.au sunshinecoast.glassnow.com.au Here is htaccess RewriteEngine On RewriteBase / ...
2
votes
1answer
31 views

Forbid users from accessing a long URL while allowing access to a shorter one with mod_rewrite

I'm trying to block the following URL: www.example.com/Ayurveda/article/guna/alkalizing/contains/non-vegan/experience/relieves-burning But I want to allow: ...
1
vote
1answer
41 views

Non existent image files are not being handled by PHP as they should due to ngnix configuration

I am currently building a web application. In order for it to work properly I wrote this rule: location / { if (!-e $request_filename) { expires 168h; add_header Pragma public; ...
-1
votes
0answers
13 views

Redirect cause double authentication

So i have a sub-directory on a pair server. Their is a htaccess file in the directory that points to a password file in a top folder. the problem that i m running to is double authentication. when i ...
2
votes
1answer
34 views

WAMP: Properly directing image paths on local server

I'm using ExpressionEngine to build a site, and have a development version running locally via WAMP. Within the root "www" folder, I have an "ee" subdirectory that acts as the root of the development ...
1
vote
2answers
71 views

Remove trailing slash and index.html in .htaccess

I seem to be stuck here trying to figure out how to redirect the following scenarios: /foo/index.html -> /foo (remove trailing slash, index.html as 301) /foo/ -> /foo (remove ...
1
vote
2answers
316 views

RewriteRule /change-email.htm?e=someone@somewhere.com&h=xxxxxx

I need to rewrite URL's of this form: /change-email.htm?e=someone@somewhere.com&h=xxxxxx to: /change-email/?e=someone@somewhere.com&h=xxxxx I've done this in my .htaccess: RewriteCond ...
2
votes
1answer
28 views

Redirecting www to non www in subfolder

I have Joomla installed on root folder and another Joomla installed on a subfolder. I want to redirect www to no-www in subfolder by this code in blog .htaccess: RewriteCond %{HTTP_HOST} ...
0
votes
1answer
209 views

Font blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin'

we are experiencing this error in Google Chrome. We thought everything was set-up correct. But maybe not? Font from origin http://skin.cdn.com has been blocked from loading by Cross-Origin ...
3
votes
1answer
34 views

Can .htaccess 301 redirects work with encoded characters?

I have an old site with titles in the URL for SEO, but it has URL encoded characters than transliterated Latin characters. Like %20 instead of space character and many other non-Latin characters. The ...
1
vote
2answers
56 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 ...
1
vote
0answers
26 views

How can you use Apache .htaccess to specify the location of the PHP binary on shared hosting?

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
40 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
43 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
53 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
49 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
0answers
38 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 ...
1
vote
0answers
55 views

ExpiresByType not working for PNG images when set in .htaccess for 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 ...
1
vote
1answer
56 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
13 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
3answers
78 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
106 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
25 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
1answer
30 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.example.com/signup$1 [R] But this is not redirecting www.example.com/registration/ to ...
1
vote
1answer
71 views

Can .htaccess be used to cache AdSense JavaScript to improve the pagespeed score?

I'm AdSense publisher and I need to improve the page speed score for my site. It already gets 90/100 for speed and 100/100 for User Experience, however Google AdSense code is preventing it from ...
2
votes
2answers
55 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
12 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 ...
1
vote
2answers
24 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 ...
0
votes
1answer
17 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
169 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 # ...
2
votes
1answer
49 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
795 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
42 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
29 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
49 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
76 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
75 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
42 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
79 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
103 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
96 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
53 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 ...