Questions tagged [mod-rewrite]
65 questions
19
votes
2 answers
Apache2 - Redirecting a subdomain to another URL
I have two subdomains, a.website.com and b.website.com, pointing to the same IP address. I want to redirect b.website.com to a.website.com:8080. I have this in my .htaccess file...
RewriteEngine on
RewriteCond {HTTP_HOST}…
Technius
- 193
- 1
- 1
- 5
3
votes
2 answers
How to hide the PHP file extension using WampServer and .htacess file?
I just installed WampServer on Windows7 and uncommented mod_rewrite and set AllowOverride to All in the httpd.config file.
I created an .htacess file and placed it in the root folder with the following statement:
options…
Fawadafr
- 31
- 2
- 4
2
votes
0 answers
Keeping Firefox from adding ".html" to url
I've been messing with .htaccess for a while, and have the following rule:
RewriteRule ^(mypage|myotherpage)/?$ main.php?p=$1 [L,QSA]
If I enter http://mydomain.com/mypage/, it displays main.php as desired.
If I enter http://mydomain.com/mypage…
user1032531
- 1,631
- 9
- 26
- 51
2
votes
1 answer
Apache mod_rewrite working with http but not https
I am configuring an apache server to change URLs from [http://(IP)/users/testuser/test.html] to [http:/(IP)/~testuser/test.html]
This works fine, as such
RewriteEngine On
RewriteRule ^/users/(.*)$ /~\$1 [R]
However when someone does…
roger34
- 55
- 2
- 7
2
votes
1 answer
htaccess how to redirect if all other rules fail?
htaccess has always given my problems. Every time I think I understand it, htaccess goes against what I just thought I understood. Any help would be GREATLY appreciated.
What I want to do with htaccess is redirect URI's…
Ryan Sullivan
- 45
- 1
- 5
2
votes
2 answers
FireFox continues to redirect based on outdated httpd.conf rules (other browsers dont)
This is really odd, because it shouldn't be happening at all.
When I access wellness.learnitlive.com on FireFox, I see it redirected to: http://www.learnitlive.com/classes-events/Health-Wellness/280.html
When I access wellness.learnitlive.com on…
siliconpi
- 2,687
- 6
- 25
- 28
1
vote
0 answers
Ubuntu 14.04 Nginx Rewrite rule issue
Problem with nginx mod rewrite. Really appreciate help. I spent hours on that issue
Problem with rewriting url.
I want rewrite from bangots.eu/?subtopic=highscores bangots.eu/?subtopic=houses
to get this
bangots.eu/highscores bangots.eu/houses
I…
Szmycu
- 11
- 3
1
vote
1 answer
URL to filesystem mapping in Apache
I have a blog which is at mysite.tld/blog. Currently mysite.tld redirects to mysite.tld/blog via an index.php in the root. Apparently when I set this up two years back I could not get the .httaccess file which is also in the root to work. On the…
Jeroen De Dauw
- 118
- 1
- 10
1
vote
1 answer
mod_rewrite path info postfix and per-dir prrefix
There's an issue with .htaccess configuration.
I just need the url /category to match the category.php script, but when I try to open this url, there's a 404 error instead.
Here's my .htaccess:
RewriteEngine on
RewriteRule ^category/ category.php…
Alexey Kosov
- 111
- 4
1
vote
1 answer
Using Apache Httpd mod_rewrite to rewrite URL based on Accept request header?
I'm attempting to rewrite a URL based on the Accept header of the request. I saw in the docs that this seems to be possible, but I couldn't find any details or examples anywhere on how to go about it.
Basically I'd like requests to /abc/index.html…
Edy Bourne
- 983
- 1
- 8
- 11
1
vote
1 answer
Cannot set up mod_rewrite with XAMPP
I'm trying to enable mod_rewrite on a XAMPP 5.6.3 installation. I've been following these…
Septagram
- 5,348
- 6
- 20
- 21
1
vote
1 answer
Reverse proxy 502 bad gateway
I have setup a subdomain to proxy my plesk panel, but when saving pages I am getting 502 Bad Gateway error instead of a completion message. I am running CentOS 6.
Here is my vhost.conf configuration for http://plesk.domain.tld/:
RewriteEngine…
Nahydrin
- 415
- 2
- 5
- 12
1
vote
1 answer
Uploadify with apache authentication
I'm trying to get a webapp working on my server.
The app is using uploadify and that is the only part that I now can't get to work.
I have a Alias to reach the app : (in /etc/apache2/conf.d/appalias)
Alias /showGreatApp…
John Master
- 111
- 3
1
vote
0 answers
apache rewrite to different domain subfolder without changing the address in browser url
Actually we have 2 sites.
Site 1: Desktop version hosted in [http://mysite1.com] , using Apache server
Site2: Mobile version of mysite.com is hosted in [http://mobilesites.com/mysite1mobile] , using Apache server.
Now,
if request comes from desktop…
Sharat
- 11
- 2
1
vote
1 answer
Configuring Apache2 to Auto redirect calls to port 80 to port 443
I am running an Ubuntu 12.04 Server-based Apache2 server with SSL. I seem to have my configuration correct to achieve SSL connections over port 443, and at first, I did not even configure the server for ANY VirtualHost on port 80.
Now, I would like…
Jonathan
- 1,290
- 4
- 11
- 19