Tag Info

New answers tagged

2

I may be missing something, but my first reaction is to not redirect (or rather internally rewrite?) if the file doesn't exist, but only when the URL does not already contain the version folder (eg. v01). For example, for .htaccess in the document root: # Internally rewrite to the latest version if not specified RewriteCond %{REQUEST_URI} !^/app/v\d\d/ ...


0

You need to use %1 (not $1) in your "2nd attempt" (as you did in your 1st attempt) and it looks like you should be almost there: RewriteCond %{QUERY_STRING} ^/page/index.html/(.*)$ RewriteRule ^index.php /index.php?/article.html/%1 [L] Although if you're in .htaccess you need to also remove the slash prefix from the RewriteRule pattern. %1 is a ...


0

I'm sure there must be a more elegant/efficient way of writing this, but this should work to do what you require: RewriteEngine On RewriteBase / # Restrict users from IP address 10.8.0.11 to user1 sub-folder RewriteCond %{REMOTE_ADDR} 10\.8\.0\.11 RewriteRule ^(user1) user1 [L] RewriteCond %{REMOTE_ADDR} 10\.8\.0\.11 RewriteRule ^(.*)$ user1/$1 [L] # ...


0

My .htaccess is in the same directory as the index.php, so: localhost/projects/project1/.htaccess That's the problem, or rather your RewriteRule pattern is the problem, depending on how you look at it. In .htaccess (per-directory) files, the per-directory prefix is first removed from the URL before matching against the pattern. So, if your .htaccess ...



Top 50 recent answers are included