Directory-level configuration file found mostly on Apache web servers

learn more… | top users | synonyms (1)

2
votes
1answer
30 views

Creating a Combined 301 Redirect in .htaccess

We are being advised by our SEO agency to reduce the number of "chained" redirects we have. So, for example: URL A - http://www.sitename.co.uk/SHOPPING-CATEGORIES/product_name redirects to its https ...
3
votes
1answer
39 views

Trouble with 301 redirect of old naked domain to new domain

Using .htaccess I am trying to setup a simple 301 redirect which redirects both exampleA.com and www.exampleA.com (the old domain) to exampleB.com (the new domain). However, accessing www.exampleA.com ...
2
votes
1answer
38 views

How to customize youtube url to dynamic pretty url? [closed]

I am creating seo friendly links for my site. I am succeeded in creating all link just the data fetch from youtube using Api is creating an ugly and long link i want is there any way out to make that ...
1
vote
2answers
34 views

Where to place 301 redirects in the .htaccess file on a WordPress site

I edited my .htaccess file earlier to redirect from www version to non-www, and it is working correctly. However, now I have some page redirects I need to do. I am looking at the .htaccess file, and I ...
2
votes
2answers
43 views

Rewrite rule for pretty URL: redirecting 'index.php?parameter' to 'slug/index.html'

My original URL is: http://example.com/video_in.php?video_id=1 and I want my link to be: http://example.com/shaandaar/kinna_sona.html shaandaar and kinna_sona are the slugs in my ...
2
votes
1answer
25 views

http header if not modified help

I am having a little trouble with sorting out my HTTP headers for my sites. I am currently setting up Varnish on my server and so trying to get everything working correctly. All my sites are ...
1
vote
1answer
32 views

An equivalent to ProxyPreserveHost in .htaccess?

I am moving a website from one shared host to another. The site is all files. I have already copied the files to the new host. I'd like to redirect all HTTP requests from the old host to the new ...
3
votes
1answer
18 views

htaccess Redirect everything to index.php little trouble

I need to redirect everything (www.example.com/, www.example.com/en/, www.example.com/en/index.php?do=xyz, etc.) to index.php, but I can't get everything working. 1st try: RewriteCond ...
3
votes
2answers
54 views

htaccess need automatic redirect + language + SEO urls

I am trying to achieve more things: HTTP:// should redirect to HTTPS:// www.example.com should redirect to www.example.com/en/ or /it/ depending on client language links should resolve to ...
1
vote
1answer
27 views

How to match only part of URL and redirect URL with parameters in .htaccess?

I have a number of links with similar structure: example.com/index.php/path/some-path/some-subpath?parameter=1 Which I want to redirect just to example.com/category/ But I want to match only the ...
0
votes
1answer
40 views

How to remove Plesk websites temporary urls from Google index?

Google is indexing Plesk temporary URLs, I've tried the following tip but it does not block those URLs. Why Google indexed the preview URL of domain? I added this to .htacess with no success: ...
3
votes
2answers
39 views

How can I use .htaccess to make old link retrieve content from new location?

One of my sites had a WordPress site in the subdirectory (root)/blog/. Using rules in .htaccess, the site was called up without the /blog/ in the URL. I recently changed it by removing the /blog/ ...
3
votes
2answers
57 views

Writing clean urls with .htaccess

Update - Alright thanks everyone for your tests, it really helped. The code is good. My problem was not having absolute "/" links. (Due to moving from public_html folder). Only 2 concerns i have now. ...
0
votes
0answers
4 views

We cannot stop subdomains redirecting to the main domain [closed]

The subdomains of our website besthomecarefranchise.info keeps redirecting back to the main site, you can see it here, http://raymondadamcik.besthomecarefranchise.info/, we've spoken w/ the techs here ...
1
vote
2answers
55 views

How to create Short URL in Mediawiki without getting an 403 Forbidden Error in Apache?

How to create Short URL in Mediawiki without getting an 403 Forbidden Error in Apache? My httpd.conf: #### Wikibase (BETA) <VirtualHost *> ServerName wikibase.isc ...
0
votes
0answers
37 views

How to redirect all pages and all subdomains of a domain to the home page of another domain

I have an domain (www.aaa.com) and an alias (www.bbb.com). The alias domain points to the aaa.com domain, but that's not what I want. I want www.bbb.com to point to www.ccc.com. I have the following ...
2
votes
1answer
59 views

How to redirect a URL without a query string to a URL with a query string?

I've looked around for the answer to my question but only to be confused even more. I'm hoping somebody can help me... I need to redirect this URL: ...
4
votes
0answers
29 views

301 Redirect with Reverse Proxy

I am currently struggling to resolve an issue stemming from a reverse proxy. We are running a reverse proxy from page.example.com to example.com/page/ . This original subdomain content is generated ...
1
vote
0answers
20 views

False Duplicate Content On Moz Report

We are using Salesforce's Visualforce to run one of our websites. We use Moz to monitor SEO issues. Moz has identified more issues pages than we have - see the attached image. We have only a few ...
5
votes
1answer
80 views

How to redirect URLs with a specific IDs to new URLs on a new domain name?

I want to redirect all pages where there is a specific word inside in the URL. Both websites have the same articles. For example: ...
3
votes
1answer
44 views

Using .htaccess deny returning 302 and not 403 forbidden

I'm in the process of adding yet another layer of security to some of my WordPress installs, since some of my customers sites use shared hosting, and generally they do not ban users for brute force ...
3
votes
1answer
40 views

Redirect percent encoded URL in .htaccess

Suppose I have the following URL: http://example.com/%D8%B3%DB%8C%D8%B3%D8%AA%D9%85-rss-%D8%B3%D8%A7%DB%8C%D8%AA-%D8%A8%D9%87%DB%8C%D9%86%D9%87-%D8%B4%D8%AF/ How can I redirect this to ...
2
votes
1answer
21 views

Query string parameters with mod_rewrite

RewriteEngine On RewriteRule ^detail.html?id=([0-9]+)-page=([0-9]+)$ detail.php?id=$1&page=$2 I rewrite URL detail.php?id=1&page=1 to detail.html?id=1&page=1. I always get the 404 ...
3
votes
2answers
106 views

How to submit shortened URLs to Google so that they are included in the index

I am working on a project to create a URL shortener. I have successfully gotten it to create short URLs, but I would like to submit them to Google. When I submit a short URL via Google Webmaster ...
2
votes
2answers
45 views

Use .htaccess to remove a subdirectory from a URL when it in turn has a subdirectory

Could anybody please tell me how to rewrite http://example.com/forum/topic/topic-name to http://example.com/topic/topic-name I do not want to simply rewrite http://example.com/forum to ...
0
votes
1answer
24 views

Did httpd can be rewrite? [closed]

I'm running on Nginx server. I try to rewrite my URL using .htacces file: RewriteEngine On RewriteBase / RewriteRule ^search/(.+)/page=(.+)$ search-results.php?q=$1&page=$2 It give me Internal ...
1
vote
2answers
51 views

.htaccess rewrite with % in query string doesn't work

I am trying to do a rewrite of the site from http://www.example.com/folder/site?data%5Bbranch%5D=xyz to http://www.example2.com/test/ Already tried the query string but facing issues with %. Any ...
0
votes
1answer
26 views

Creating sub-directories in public_html without effecting higher scope files ( index.php )

I have in my Navigation bar: "example.co/index.php (home), example.co/action.php, example.co/car.php /etc". Now I have my games in the "/games/" directory But once I click on a game in /games/ ...
2
votes
2answers
39 views

mod_rewrite ignore Stylesheet and JavaScript

I have a mod_rewrite to allow example.com/location as example.com/?page=location RewriteEngine On RewriteBase / RewriteCond %{QUERY_STRING} !^page RewriteRule ^(.*)/?$ /?page=$1 [L] But how do I ...
3
votes
1answer
69 views

.htaccess syntax multiple RewriteEngine on

I'm learning to maintain my own WP site. After a lot of reading I ended up with my "complete" htaccess file that looks something like this DirectoryIndex index.php # Disable directory listings ...
0
votes
0answers
5 views

Excluding a file from an IP block [duplicate]

I have recently converted a pre-2.4 configuration to Apache's new authorisation configuration but ran into a problem/misunderstanding concerning more than one RequireAll block. What I am basically ...
2
votes
0answers
72 views

RequireAll blocks overriding each other

I have recently converted a pre-2.4 configuration to Apache's new authorisation configuration but ran into a problem/misunderstanding concerning more than one RequireAll block. What I am basically ...
1
vote
1answer
36 views

My subdomains to a folder won't work

I'm trying to host a WordPress network. Though, the network doesn't work with the built-in WordPress subdomain redirection, that's why I create directly the subdomains at my host (legtux.org, a free ...
1
vote
3answers
94 views

How to avoid MP3 downloading sites from using my files?

I have a WordPress site where I'm gonna host files such as MP3s. The thing is I know if I don't do anything, MP3 Crawlers like mp3glu or mp3pleer will come and use my files and bandwidth, which I ...
1
vote
0answers
29 views

Separate multiple domains with htaccess (solution works on one hosting, not on another)

I have two different domains on one VPS. It's Apache 2.4.7, I remember trying long to set up name based Virtualhosts on localhost to find out Apache Virtualhosts are not supported anymore. (I cannot ...
1
vote
1answer
12 views

how to prevent load image on special sites [duplicate]

how to prevent load my website images on special sites because many websites hotlink my website images How to Detect and Stop Image Hotlinking on my Website thanks
2
votes
2answers
59 views

How to change whole folder from http to https

The checkout/onepage is working with HTTPS. But, why checkout/cart is not? Here is fragment of the .htaccess: ############################################ ## enable rewrites Options +FollowSymLinks ...
1
vote
3answers
45 views

Regular expression for Apache redirection

In the .htaccess file I would like to redirect (301): From: http://www.example.com/photo<anything> To: http://www.example.com/blog/ Basically, any URL starting with /photo should be redirected ...
0
votes
1answer
30 views

Google not updating title with htaccess expires

It's been 2 weeks I've changed my website title and still Google hasn't changed the title in search engine. I think it's because of if modified since header... my website is generating 201 OK status ...
2
votes
2answers
113 views

Forcing HTTPS and WWW with apache

Apache does not force HTTPS in a subfolder of a folder, but it works in the first level subfolders. Here are all the HTAccess snippets I have tried: RewriteCond %{HTTP:CF-Visitor} '"scheme":"http"' ...
2
votes
2answers
62 views

Redirect to non-www and non-https in htaccess

I need to redirect my WordPress blog from https://www.example.com/blog to http://example.com/blog using the .htaccess file. This is what I have so far: <IfModule mod_rewrite.c> Options ...
1
vote
1answer
25 views

Use .htaccess to convert user ID's to usernames? [closed]

I want to use .htaccess to convert the urls that link to profile pages from an ID number to a name. For example, on Facebook, if you were to go to: https://facebook.com/profile.php?id=4 It would ...
2
votes
2answers
131 views

Multi-language site, landing page

Couldn't find a similar question here, and seems kinda simple, so sorry if this has been asked before. I'm developing a site with dual language, setup in the following format: ...
-1
votes
2answers
78 views

How to set execute-only permission for a php script in a .htaccess file?

I'm really a newbie in web-technologies, so this question may be silly. I have a php script that accesses a database, therefore it stores a database password (tell me a better way to store this ...
1
vote
1answer
30 views

How Do I Remove A Subfolder Using Htaccess?

I am trying to remove /view from example.com/businesses/view so you can go to example.com/businesses and it works correctly. Here's what's in my htaccess already: DirectoryIndex index.php RewriteBase ...
1
vote
2answers
50 views

How to deny direct access to font files used in CSS?

I have a website that displays texts with unique, copyrighted fonts. I use a CSS file with "font-face" elements (see the example below) and I store the font files in a folder called "type". I would ...
1
vote
1answer
53 views

PHP webpages in sub-directory cannot be accessed

I've got a university club website at thing.uni.ac.uk/meow/foobar which also has the domain foobar.co.uk. I don't have access to the config. I set up this website using HTML/CSS/JS alone and it's been ...
2
votes
2answers
44 views

Need .htaccess mod_rewrite for serving static content from subdomain, but forcing www otherwise

I have a website where I currently force example.com visits to www.example.com, and it has an SSL certificate, so I also force HTTP to HTTPS. My SSL certificate covers example.com and www.example.com. ...
6
votes
1answer
83 views

.htaccess rewrite url leads to missing css

I am trying to make my url from this: www.domain.com/view.php?id=15 To ths: www.domain.com/watch/15 My code in htaccess is as follows: Options -Indexes Options +FollowSymlinks ...
2
votes
1answer
56 views

After rewriting URL page not found

I want to rewrite my current URL that is http://localhost/sitename/landing-page/?from=Algeria&to=Afghanistan&submit=Submit to http://localhost/sitename/removals-from-Algeria-to-Afghanistan ...