New answers tagged

1 vote

How can I remove 2 separate portions of a URL using mod_rewrite?

In the .htaccess file located in the subdirectory at /library/photography/.htaccess you can do something like the following using mod_rewrite to internally rewrite the request to the desired URL. ...
  • 11.8k
1 vote

How can I remove 2 separate portions of a URL using mod_rewrite?

I am not 100% sure this is the best way to do it, but given the following folder structure user@instance-apache:/var/www/html$ tree -a . ├── .htaccess ├── index.html └── library └── photography ...
  • 700
1 vote
Accepted

Apache mod_rewrite RewriteRule loops despite L flag

The L flag only stops the current pass through the rewrite engine, it does not stop all processing. The directives that follow are not processed immediately, but (in a directory context) the rewriting ...
  • 11.8k
1 vote
Accepted

Can't get Apache rewrite to work on Docker PHP-Apache container

I've actually figured it out. The problem seems to be that, when using docker, you must specify the rewrite rules within the Virtual Host context of the port you've specified. At least I've done what'...
  • 135
0 votes

htaccess, block access a url with parameters

You can block access (eg. trigger a 404 Not Found) when a specific path (/path/) is requested with any query string using mod_rewrite at the top of the root .htaccess file. For example: RewriteEngine ...
  • 11.8k
0 votes

htaccess syntax issue when moving script to a subfolder

RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !(template/) RewriteRule . /index.php [L] For this to ...
  • 11.8k

Top 50 recent answers are included