Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [mod-rewrite]

The tag has no usage guidance.

0
votes
0answers
5 views

how do I enable mod_rewrite for use in omeka? [closed]

I have coded everything correctly up to the point of installation (I followed a step-by-step tutorial and everything was fine up to this point). I am attempting to download omeka using xxamp. I have ...
0
votes
1answer
40 views

Regular expression

I need to write a mod_rewrite rule that would match the following string: /modules/users/users/ae/ghwjzL9D2qpnPqv3FRY3JTZ48N the only constant part of the string is /ae/. I need a regular ...
1
vote
1answer
28 views

How I can add Rewrite rule in htaccess only for home page?

I have a problem with apache. My site has these rules now: RewriteCond %{HTTP_ACCEPT} text/html [NC] RewriteCond %{HTTP_HOST} ^mysqite\.com [NC] RewriteRule .* path/to/html/my.html [L] I need ...
0
votes
0answers
44 views

Why am I getting a0.invalid_state when running remotely but it works locally

I am working on an app that is deployed to an environment that uses httpd.conf to rewrite (mod_rewrite) the url to https and the ssl.conf proxies (mod_proxy) the request to 8080. I am using Auth0 for ...
1
vote
1answer
34 views

SSL forwarding for just one subdomain in .htaccess

I have Apache(ubuntu) server and I need to force https just for sub1.domain.com. Currently all traffic are being forwarded RewriteEngine On RewriteCond %{HTTPS} ...
1
vote
0answers
110 views

redirect subdirectory requests to alternate server:port

I'm using the following .htaccess to redirect requests to domain root ( http://example.com ) in apache to an alternate webserver on the same host listening on an alternate port ( http://example.com:...
1
vote
2answers
82 views

How to map sub domain to internal IP adress

I'd like to reach some internal services like the web client of my NAS (Synology DSM) through dedicated sub domains like https://nas.example.com. The services are fully running and accessible via ...
0
votes
1answer
116 views

Removing lingering end string after RewriteRule

I've tried everything but just can't seem to get things right :( I have over 800 urls and I need to rewrite them to point to a simple pdf file. Currently, I have links to: http://subdomain.mydomain....
0
votes
0answers
52 views

How to redirect url in htaccess with regex?

My url is changing and for example now it is ..safety-bathroom then is changing to safety-bathroom-1 and so on, to avoid daily changing rule in htaccess I would like to have a rule which will do ...
1
vote
1answer
273 views

redirect non-www to www for a specific subfolder only

I am trying to redirect one subfolder of my website to www if its not having www prefix. For example. If user opens example.com/sites it should redirect to www.example.com/sites Also, If user ...
1
vote
0answers
315 views

Apache redirect for url with multiple query string

I am trying to write a url redirection for a url with multiple query strings. https://www.example.com/site/template/?tab=ab&mediaId=2842247 to NEW URL: https://www.example.com/new-dynamic-...
1
vote
2answers
1k views

Apache ProxyPass by dynamic hostname

I am trying to configure Apache to proxy to an internal server based on dynamic hostnames and using other ports. It seems to be a little bit too complicated for me. This is what I have: <Location /...
0
votes
1answer
22 views

Convert If rewrite rule to modrewrite

Please help me to convert below to a modrewrite rule. <If "%{HTTP_HOST} == 'm-dev.domain.com'"> Redirect "/subdomain/page-to-load" "http://m-dev.domain.com/subdomain/page-to-load-mobile" </...
0
votes
0answers
35 views

rewrite URL with respect to request domain in apache

I want to serve different files when user calls a URL from different domains. For instance, I have a desktop version and mobile version of the website. I want to serve a specific file when user access ...
1
vote
1answer
416 views

How to proxy requests to a localhost route to a non-local url

I am setting up a local environment for testing using WAMP. The app (angular app) sits in the /wamp/www/app/ directory. It makes requests to another api by sending requests to another route on its ...
1
vote
0answers
131 views

Cannot load mod_rewrite Apache module

I am trying to use mod_rewrite module of Apache24 server, but I am not being able to load it. I know there have been many questions asked regarding this topic and I have gone through all of them but ...
1
vote
0answers
779 views

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 ...
0
votes
1answer
1k views

Using Nginx rewrite to change the shown URL from an IP?

I can't find any info on this so I don't know if it's even possible, but I was wondering: Can I use NGINX's rewrite module to change the displayed URL from, for example 123.123.123.123:6000/some/path, ...
1
vote
0answers
146 views

How to rename Webdav folder in another

In my server with apache and mod_dav have the following webdav rules in config Alias /admin_folder /var/www/test_site_cloud/web/admin_folder/files so I have /admin_folder mount. Now I need to rename ...
1
vote
0answers
191 views

Rewrite without url changing

I would like to redirect (without url changing) from mysite.com/order/business to mysite.com/order/index.php?tariff=business I have this .htaccess: Options +FollowSymLinks RewriteEngine on ...
0
votes
1answer
2k views

.htaccess RewriteRule to redirect all to root

I would like to redirect every request to root by using RewriteRules in my .htaccess file (later on I will copy them to a vhost file). I tried something like this: RewriteRule ^(.*)$ http://test....
1
vote
0answers
107 views

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 ...
0
votes
1answer
75 views

RewriteRule not redirecting to specified URL

Here is my rewrite rule: RewriteRule ^rest/v(?:[0-9.]+)/((?:[A-Za-z]+)/(?:[A-Za-z]+)(?:/(?:[A-Za-z0-9])+))?\.(json)$ https://localhost/rest/v1/index.php?url=$1&type=$2 [QSA,NC,L] It’s something ...
0
votes
1answer
889 views

Restrict access in apache except for one URL when using “master file” and mod_rewrite

I successfully applied basic authentication to my entire website but now I want to make an exception for a specific URL pattern. From what I understand, I can use the directive but so far, it isn't ...
0
votes
1answer
4k views

.htaccess file not running and internal server error

I am using ubuntu 14.04 and have LAMP environment. I have one of the project in dir /var/www/html/project1 . It can't access the .htaccess file for rewriting url rules. For that i have to change in /...
0
votes
1answer
15 views

apache2 RewriteEngine subfolder configuration is not wroking as expected. I am not sure how to correct it

The rewrite engine appears to be "functioning" but not as expected. Here is the dir tree of my public_html folder (serving using apache2 in my userdir) ┌─[admini@linuxbox][~/public_html] │ [13:16:45 ...
0
votes
2answers
4k views

Apache http to https redirect with Rewrite

Using Apache 2.4 on OS X Yosemite. Need to modify this virtual host for it to redirect http://server.kibana and http://www.server.kibana to https://server.kibana Here is the Vhost: <VirtualHost *:...
1
vote
1answer
1k views

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 ...
1
vote
1answer
832 views

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: ...
1
vote
1answer
1k views

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. ...
0
votes
1answer
212 views

Redirect from secure site to non-secure site with wildcard subdomain

I have the following set up in apache2.conf: <Directory /var/www/html> RewriteEngine on RewriteCond %{HTTP_HOST} ^(www\.|)mydomain\.com$ RewriteCond %{SERVER_PORT} !^443$ ...
1
vote
1answer
5k views

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 guides: http://www.leonardaustin.com/blog/technical/enable-mod_rewrite-in-xampp/ http://www.lancelhoff.com/...
0
votes
1answer
30 views

Using Apache RewriteRule

I'm attempting to get a very simple RewriteRule working in Apache - I've set Apache2 up (in Vagrant) and run sudo a2enmod rewrite successfully (and restarted Apache after), with the following trivial ...
1
vote
1answer
1k views

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 ...
0
votes
1answer
60 views

Redirect domain name

I have two domain names pointing to my server. I want them both to serve identical HTML. I thought I would just do the following, however, it was unsuccessful. Note that I eventually will want ssl ...
0
votes
2answers
110 views

apache mod rewrite - how to determine what file on disk is being hit?

A project that I am newly working on has been around for years, and it has managed to accumulate several hundred rather complex RewriteRules within the Apache conf files. When working with some files,...
2
votes
0answers
151 views

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 ...
0
votes
2answers
5k views

The requested URL xxx was not found on this server

I have been tearing my hair on this for hours..please help.. I have been running several websites on localhost for months without a hitch. Unfortunately last week I had do do a fresh instal of ...
1
vote
1answer
1k views

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) ...
0
votes
1answer
860 views

How do I write a rewrite rule for a virtual host in Apache?

I have a subversion server that is working fine; however, I bought a tool that requires that the project have a "branches" subdirectory an is case sensitive. The entire repository already has projects ...
0
votes
1answer
420 views

Block all referer request on Apache

I use my Apache server for a B2B application and I want to block all the referer requests like this one : [Tue Aug 13 14:23:05 2013] [error] [client 74.63.192.51] File does not exist: C:/Program ...
0
votes
0answers
73 views

How do I stop a Rewrite Rule from happening on my localhost IP?

I thought this would work but it just takes me to my live site RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.mydomain\.co.uk RewriteCond %{HTTP_HOST} !^127.0.0.1 RewriteRule (.*) http://www....
1
vote
0answers
417 views

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 ...
15
votes
1answer
27k views

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 ...
1
vote
1answer
3k views

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 ...
1
vote
0answers
336 views

mod-rewrite rule not working properly for files in sub directories

I'm using the following rewrite url to get prettier urls: RewriteRule (\d+)/(.+) $2?companyId=$1 [NC,L,B,QSA,NE] The url /invoices.php?companyId=123 can for example be expressed as /123/invoices....
0
votes
1answer
1k views

.htaccess - subfolder URL Clearing

I don't seem to be able to do the following in my .htaccess I have my script in a sub-folder inside my root directory, let's call it "ecommerce", and inside that sub-folder I have my .htaccess. I Am ...
0
votes
4answers
3k views

.htaccess file mod rewrite in godaddy

i have a problem with .htaccess mod rewite in godaddy server. i have .htaccess file like # Options Options -Multiviews Options +FollowSymLinks RewriteEngine on RewriteRule index-hotel_in-(.*)\.htm$ ...
1
vote
0answers
183 views

.htaccess Not Working as Expected [closed]

I have a hosted account not linked to any domain at /~me. In this home directory I have a .htaccess file: Options +FollowSymlinks RewriteEngine on RewriteRule 123.html cgi-bin/example.php [nc] ...
1
vote
1answer
98 views

Is there a way to detect regular expression support in a htaccess file?

I use to following rewrite rule to pass the whole url to an php script: RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^(.*?)$ index.php?rewriteUrl=...