Questions tagged [mod-rewrite]

67 questions
20
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
  • 303
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
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…
2
votes
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…
Brian
  • 465
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,711
2
votes
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…
J Mac
  • 1,320
2
votes
2 answers

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
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…
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,827
  • 6
  • 27
  • 28
2
votes
0 answers

Why are Apache RewriteMap paths no longer being treated as absolute paths?

I use RewriteMap with the prg: in Apache (v2.4.41 Ubuntu) to rewrite some requests. I've used this for some time and my rewrite program has returned absolute paths to the final file, and this has worked great until recently. For some reason…
2
votes
0 answers

Lighttpd Proxy to Service on Another Port

I have an issue, which I hope is common enough to be resolved quickly. Specifically, I have a server on which I wish to host several web-applications at the same time for my own personal use. I would like it to be well-organized however. My current…
RedHack
  • 500
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
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…
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,678
1
2 3 4 5