Questions tagged [mod-rewrite]

The mod_rewrite module uses a rule-based rewriting engine, based on a PCRE regular-expression parser, to rewrite requested URLs on the fly.

Filter by
Sorted by
Tagged with
1 vote
1 answer
875 views

Enable .htaccess On Ubuntu 20.04 LTS and Apache-2.4.41

I have a problem when moving my website to VULTR VPS - Ubuntu 20.04LTS with Apache - 2.4.41 I'm using Opencart for my website and my problem is whenever I move .htaccess file to the new hosting, the ...
Ken's user avatar
  • 21
0 votes
1 answer
3k views

Rewrite Rule not working in .htaccess file Ubuntu 22.04

I've created a .htaccess file for my site running on my own server, Apache Ubuntu 22.04, where everything works fine except for Rewrite Rule. I definitely have mod_rewrite turned on as when I created ...
Joe Brown's user avatar
0 votes
1 answer
1k views

apache2 redirect going to default domain

I'm trying to redirect all requests for ardsley73.com (or at least www.ardsley73.com) to www.ardsleyhigh73.com. I tried the following rewrite rule in sites-available/ardsley73.conf, but after enabling ...
Mark Olbert's user avatar
1 vote
1 answer
290 views

How to complete my URL header in .htaccess

I have a website www.example.com running on Apache. Maybe someone got to me via example.com, or www.example.com, or http://example.com, or even http://www.example.com. Can I use the rewrite rules in ....
Daniel Kaplan's user avatar
1 vote
1 answer
489 views

Adding RewriteRule to <Directory> to allow a link to anchor a Section in the same page

I used to host my websites with third-party hosting service and anchoring links was always easy. Then I decided to set my VPS. Everything is working well, besides the anchor links. I found out that ...
igortp's user avatar
  • 11
0 votes
0 answers
1k views

.htaccess files being ignored by Apache2 on Lubuntu 18.04

My wordpress install is ignoring my .htaccess file. I am running Lubuntu 18.04 locally with Apache2. The root directory for localhost is at /var/www/html and my wordpress project is in that folder ...
Sean D's user avatar
  • 323
2 votes
1 answer
121 views

Apache web server - how to strip language extentions

This question pertains to publishing the Ubuntu Serverguide on help.ubuntu.com. For the 20.04 LTS cycle, there will (O.K. might) be significant changes to the source code workflow for the Ubuntu ...
Doug Smythies's user avatar
0 votes
0 answers
696 views

how to enable mod_rewrite for SSL enabled site in ubuntu 16

The mod rewrite is not working for my WordPress site The hosting is Google with Ubuntu 16 I have added "Allowoverride to All in cd /etc/apache2/sites-available$ cat 000-default.conf The contents ...
Umar's user avatar
  • 123
0 votes
1 answer
2k views

Apache rewrite URL not working in vhost.conf

this my vhost.conf <VirtualHost *:80> <files xmlrpc.php> order allow,deny deny from all </files> ServerName www.myserver.com ServerAlias myserver.com ...
GHOST's user avatar
  • 347
1 vote
1 answer
875 views

.htaccess Redirect results in a redirect loop

So on my site, my shopping cart is located at example.com/zc2. I use this .htaccess file: RewriteEngine On Redirect /index.html https://example.com/zc2/ So that anyone that lands on example.com ...
Monkeybus's user avatar
  • 141
3 votes
2 answers
4k views

How to set Apache virtual host correctly for Drupal 8

I installed the Drupal website in this path: /var/www/html/testdrupal.localhost/public_html/drupal/web Below I show the virtual host configuration file testdrupal.localhost: <Directory /var/www/...
Alessio Frabotta's user avatar
1 vote
0 answers
291 views

Apache Rewrite sends to previous directory, local index.php not read

I can't solve a problem I have with (seemingly) Rewrites in Apache2. It's a migration from server P3 (where everything works) to server P10. The config files are the same, as well as the directory ...
Bibelo's user avatar
  • 389
0 votes
2 answers
9k views

Apache Rewrite module not working correctly

Keep on getting below error on Ubuntu 16.04 LTS. 404 Not Found The requested URL /application/templates was not found on this server. Apache/2.4.18 (Ubuntu) Server at 00.0.0.00 Port 80 In the error....
Anand Huded's user avatar
0 votes
1 answer
1k views

rest api ubuntu 17.10 apache mod_rewrite .htaccess

I just try and try and try ... I can't get a redirect to my index.php (restful api). .htaccess: Options -MultiViews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [QSA,...
user30424's user avatar
  • 153
0 votes
1 answer
199 views

Apache rewrite rules error

Some rules are working properly, and everything is properly set up in the conf files to allow rewrites to work correctly But some rules are failing or may be the url string doesnot reach that rule and ...
Sahil Garg's user avatar
0 votes
1 answer
2k views

mod_rewrite loaded but phpbb url rewrite option not working

mod_rewrite PHP module loaded but phpbb URL rewrite option not working Software Versions: - Ubuntu 16.04.3 LTS - Apache 2.4.18 - PHP 7.0 - Loaded Modules: Virtual Server Yes Server Root /etc/...
TheBlueKingLP's user avatar
2 votes
2 answers
5k views

Apache mod_rewrite rules don't work with dynamic virtual host and php-fpm

I've created a dynamic virtual host using this configuration file: UseCanonicalName Off <VirtualHost *:80> ServerName %1.dev ServerAlias *.%1.dev ServerAdmin daniel@localhost ...
danielperaza's user avatar
0 votes
0 answers
913 views

Apache rewrite work on http, but not working on https

I am using apache 2.2, trying to make rewrite from one url subdomain to another domain, it is working properly on http vhost, but on https not working at all /etc/apache2/domain1.conf: <...
MohammedSimba's user avatar
3 votes
1 answer
15k views

The requested URL not found - in Digital Ocean LAMP Webmin server

I'm new to Digital Ocean & Ubuntu, in the midst of migrating from Exabyte shared server's Codeigniter (v3) website to Digital Ocean server Server details/installation : Digital Ocean Droplet - ...
Mavichow's user avatar
  • 151
0 votes
1 answer
2k views

Using Nginx as a reverse proxy for a PHP site using Apache with URL rewriting

I'm trying to use Nginx as a caching reverse proxy for Apache running a PHP site. It's kind of working but the problem comes when trying to rewrite the URL to the Apache setup, it doesn't work as I ...
Wasim's user avatar
  • 101
5 votes
1 answer
8k views

How to enable clean url with Ubuntu 16.04, Drupal 8.1.10 and Apache 2

I'm trying to install Drupal 8.1.10 on a virtual private server (OVH) with Ubuntu 16.04, Apache 2 and PHP7. I followed this tutorial : https://www.howtoforge.com/tutorial/how-to-install-drupal_8-...
JPO's user avatar
  • 51
0 votes
1 answer
2k views

403 Forbidden on virtual host with mod_rewrite

I managed to install virtual host on LAMP server and created the config file /etc/apache2/sites-available/site.com.conf <Directory /home/ihab/Workspace/Webdev/site.com/public_html> ...
user avatar
0 votes
1 answer
1k views

Apache subdomains wildcard redirection

Is there a way that i can redirect wildcard vhost on apache sub-domains to another domain? i.e, https://abc.domain1.com --> https://abc.domain2.com https://xyz.domain1.com --> https://xyz....
MohammedSimba's user avatar
0 votes
1 answer
6k views

Redirect from https domain to another https domain

How can i redirect apache from one "https://domain1.com" to "https://www.domain2.com" I tried it as following: <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName ...
MohammedSimba's user avatar
0 votes
1 answer
1k views

How can I enable mod_rewrite on Ubuntu Server?

I'm trying to enable mod_rewrite on my new server. I installed LAMP and configured the rest using webmin, but I can't run mod_rewrite. I get the URL Not Found page when I make any changes in configs ...
thecgla's user avatar
  • 21
3 votes
2 answers
6k 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 /...
Farman Ali's user avatar
0 votes
3 answers
7k views

Remove '.php' from url - Nothing works

Ubuntu 14.04LTS 32bit LAMP I know it's an old question but.. I need it to remove .php anywhere it finds it from the visible url. It needs to work with /showthread.php?id=XX ---> /showthread?id=XX ...
Myst's user avatar
  • 133
0 votes
1 answer
346 views

Apache 2.4: pcfg_openfile unable to check htaccess / php warning include() failed opening for inclusion

Situation I've installed Ubuntu 14.04 on my desktop, and now need to get Apache 2.4 working with my local websites. With 12.04 this all worked. Now I get two errors, and googling for these errors I ...
SPRBRN's user avatar
  • 2,295
0 votes
1 answer
68 views

Problem using mod_rewrite to support canconical URL

I'm having some difficulty with mod_rewrite and suspect I'm making a basic error. My goal is to set-up a canonical form on my server so that all access (by domain or IP address) goes without ...
Warren Vick's user avatar
6 votes
2 answers
7k views

Why do I get 404 on LAMP Permalinks (Using wordpress)

I have been working on a website on an ubuntu server (amazone) and I get 404s entering pages. I'll give all the information I can regarding the problem. On WordPress Refresh page: I followed ...
Kar19's user avatar
  • 461
2 votes
1 answer
2k views

How to add and enable rewrite module in manually installed apache httpd web server?

I installed apache httpd server by compiling source on Kubuntu 14.10. I ran wget http://www.us.apache.org/dist//httpd/httpd-2.2.29.tar.gz tar -xzf httpd-2.2.29.tar.gz cd httpd-2.2.29 ./configure --...
Alok's user avatar
  • 474
3 votes
2 answers
46k views

HTTP to HTTPS rewrite rule not working

ubuntu 14.04 Apache/2.4.7 I am posting here conf file for my virtual host and default ssl host. not able to figure what am I doing wrong. http://<website_url> shows the index of the ...
rajeev's user avatar
  • 173
4 votes
5 answers
23k views

how to config htaccess file after enabling mod_rewrite module?

I already install apache2 then i enable the mod_rewrite module like this: sudo a2enmod rewrite after enabling i am confused about these lines, i can't understand what to do with them, as far as i ...
jazz_razor's user avatar
0 votes
1 answer
12k views

How to configure mod_rewrite correctly while using CakePHP?

This at first might look like a duplicate question but I have done 10 hours of research on Internet and tried almost everything I've found but no luck with mod rewrite. Most of the post/tutorials on ...
Darin Park's user avatar
0 votes
1 answer
1k views

.htaccess Apache Mode Rewrite not Working

New to Ubuntu and trying to set-up PHP environment. Now most of the things are set but .htaccess file not working at all for my CMS. I have two sites /var/www/one/ and /var/www/two/ now when I hit ...
pixelngrain's user avatar
23 votes
5 answers
121k views

mod_rewrite is enabled, but not working

I'm trying to get a PHP routing library set up. They give this example for a .htaccess file: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . ...
Freddy Heppell's user avatar
30 votes
3 answers
187k views

Enabling .htaccess file to rewrite path (not working)

All the tutorials tell me to edit the: /etc/apache2/sites-available/default but this file doesn't exist for me. Within this file I would have to edit the: <Directory /var/www/> Options Indexes ...
inControl's user avatar
  • 403
7 votes
3 answers
38k views

mod_rewrite use in Apache 2.4

Okay, so there are plenty of threads on how to use mod_rewrite, but I find it seems to work a bit differently in Apache 2.4. I tried this: <Directory /var/www/vhosts/example.com> <IfModule ...
Tjita1's user avatar
  • 493
0 votes
1 answer
3k views

How To Write To SD card

I heard of people saying they could if they did it as a root user. How do I do that. When I tried to write to sd card, I got a read only error. Permissions says Owner: me Access: Create and ...
DPrice's user avatar
  • 143
0 votes
1 answer
3k views

Apache2 server failed to start after enabling `mod_rewrite`, returns "Operation Not Permitted" errors

I am trying to install cakephp ( a php framework) which requires to enable mod_rewrite. For this I followed Enable mod_rewrite answer. But after restarting my server It says: nitish@nitish-G31T-M7:~$ ...
Nitish's user avatar
  • 103
0 votes
1 answer
420 views

Should I put .htaccess rules in 000-default or httpd.conf?

I'm trying to move all .htaccess rules to httpd.conf. Problem with that is httpd.conf is blank (apparently this is by default-I'm using 12.04). I checked apache2.conf and found that httpd.conf was ...
TryHarder's user avatar
  • 127
1 vote
1 answer
4k views

Problem with apache 2.4.6 on ubuntu 13.10 no rewrite for wordpress links

My rewrite was working well until i updated my apache and than went dead . My 000-default.conf <VirtualHost *:80> # The ServerName directive sets the request scheme, hostname and port that ...
itwolfpower's user avatar
1 vote
1 answer
831 views

Is the rewrite module activated for nginx in the Wordpress juju

Is the rewrite module activated for nginx in the Wordpress juju? When I change the permalink to anything other than default I get bad gateway. rewrite is mandatory for buddypress to function properly....
user2291975's user avatar
0 votes
1 answer
3k views

what is the nginx equivalent command apache has for a2enmod?

I'm following this guide: How to Setup OwnCloud Server 5 with SSL Connection Problem though is that the guide is for apache but I am using nginx for my server. As such I am trying to "reverse ...
wardr's user avatar
  • 2,289
0 votes
1 answer
1k views

Url rewrite does not work ubuntu server

Currently I am working with a php script but it still contains an unfriendly link (cms.php?Cms=login). I want to turn it into a friendly link /cms/login I have an .htaccess file is created ...
Daan Seegers's user avatar
1 vote
1 answer
6k views

How can I enable mod_rewrite logs?

I'm having trouble with my .htaccess redirects, and I want to enable logs on the the mod_rewrite module so I can figure out what's going on. The trouble is, httpd.conf doesn't seem to exist anymore in ...
Jonathan's user avatar
  • 7,440