Maps different parts of a host file system into the document tree and it used for URL redirection
Questions tagged [mod-alias]
65 questions
1
vote
3 answers
How to redirect multiple domains to "www." with mod_alias "Redirect" directive?
I'm trying to redirect multiple VirtualHosts without a preceeding "www." from one VirtualHost to another, like so:
ServerName example.com
ServerAlias example.org
ServerAlias example.net
# I either need some kind of…

Jeff
- 1,416
- 3
- 28
- 50
1
vote
0 answers
Apache 2.2 RedirectMatch behaviour in a Directory context?
What is the URL provided to a RedirectMatch in a Directory context? Does Apache remove the part of the URL up to the current directory?
For context, I am trying to write a RedirectMatch in a directory context, and I want to know if I can anchor the…

Ricky Morse
- 173
- 1
- 5
1
vote
1 answer
What .htaccess directives do I use to securely redirect www_public to www_my_new_public?
I'm moving a site to a new shared host. I want to have a folder of php includes below the live directory and available to public php pages. What directives should I add to the .htaccess file in www_public?
The basic should be some version of…

xtian
- 321
- 3
- 15
1
vote
2 answers
How to redirect (or Alias) jump page with Apache
I'm not an Apache expert but need to make a small change to a web server. We are introducing a "jump page" URL that is different from a primary URL (for tracking reasons).
/productA/index.html
/productA/jump_index.html
Basically i want to log that…

Meltemi
- 579
- 2
- 11
- 24
1
vote
1 answer
Apache AliasMatch with Multiple Subdomains
I have the following virtual hosts:
ServerName article.example.com
AliasMatch "^/(.*)" "/var/www/html/article.php"
ServerName company.example.com
AliasMatch "^/(.*)"…

Maciek Semik
- 139
- 6
1
vote
1 answer
Apache RedirectMatch not matching double slash
I want to redirect URLs with multiple consecutive slashes (e.g. //) in the path to have only one consecutive slash, e.g.
https://example.com/a//b/c/ → https://example.com/a/b/c/.
My .htaccess file contains the following statement.
RedirectMatch 301…

fionn
- 13
- 5
1
vote
1 answer
How to create alias to url in Apache 2
I have main url like http://apps1.example.com and i want create alias like
http://apps1.example.com/svc-base
in my vhost config
ServerName apps1.example.com
ProxyPreserveHost On
ProxyPass / http://123.456.7.8:880/
…

Aleh
- 11
- 1
1
vote
1 answer
Redirect French homepage (and only FR home page) to English home page
Using the .htaccess file, I would like to redirect www.example.com/fr/ to www.example.com/ but not other French pages that have the /fr/ root (e.g. www.example.com/fr/page-name)
I've tried using Redirect 301 /fr/ https://example.com/ but that…

Samuel
- 13
- 2
1
vote
1 answer
2 websites hosted on same domain, 1 needs to look like a subfolder ( /blog)
I bought a VPS for my new project running apache.
On it I have 2 websites on the same domain.
The first one is Ruby on Rails /var/www/html
The second one is Wordpress /var/www/blog
I want Wordpress to act like a subdirectory of ruby ( /blog).
Ruby…

Adelle
- 13
- 3
0
votes
1 answer
How to add the trailing slash in general for an Apache + CDN architecture (without using Apache mod_rewrite)?
I would like to add the trailing slash in general when it is absent in the request URL:
when user requests https://example.com/blog, it should be redirected to https://example.com/blog/
when user requests https://example.com/abc.jpg, it should be…

shintaroid
- 101
- 4
0
votes
1 answer
Remove slash from URL with htaccess redirect
I am using the following directive in my .htaccess file:
RedirectMatch 301 ^/user/(.*)?$ http://$1.example.com/user/$1
to redirect the URL
example.com/user/koko/
but it redirects to http://koko/.example.com/user/koko instead of…

Lolak
- 141
- 1
- 7
0
votes
1 answer
404 Error for Permalinks with Apache Alias and Wordpress
I have scoured several pages, answers and articles in an attempt to correctly configure Apache Alias and Wordpress Permalinks without success.
/var/www/
| - example.com (Custom Web App)
| - blog.example.com (Wordpress)
Using the structure above, I…

Ralph
- 862
- 11
- 26
0
votes
0 answers
Apache "alias" stopped working
I have a web server running since 2014 on Windows Server 2008R2 with Apache 2.2.25, PHP and stuff. It has some Alias directives inside its config entry, which seemingly had stopped working some time ago. Nothing and really nothing has…

Vesper
- 794
- 1
- 9
- 32
0
votes
0 answers
Apache Rewrite Redirect with dot in url
In .htaccess:
RewriteCond %{HTTP_HOST} ^domain.info
RewriteRule (.*) http://www.domain.info/$1 [R=301,QSA,L]
In server .conf file:
Alias "/.well-known/acme-challenge" "/tmp/.well-known/acme-challenge"
Problem is that when I call:…

Pavel
- 417
- 1
- 7
- 17
0
votes
1 answer
Alias in subdomain
i want to create an alias in my subdomain.
The easiest way to do for my host is this :
Alias "/docs" "/var/sudomain/web"
Here all requests from http://google.io/docs will use folder /var/sudomain/web
but i want to do this
Alias "subdomain/docs"…

Walden
- 3
- 2