New answers tagged

0

The # and everything after it should never get sent with the request. That's just for linking to named a tags


0

The RewriteRule pattern matches against the %-decoded URL-path. So, if the requested URL contains %23 (a URL encoded #) then you need to match a literal # in the RewriteRule pattern. Otherwise, your redirect seems to be OK. For example: RewriteRule ^(.*)#(.*)$ /$1#$2 [L,R=301,NE] The NE (noescape) flag is required here in order to prevent the # in the ...


0

The regex ^([^/]+)/? only captures the first path segment, ie. [^/]+ matches 1 or more non-slash characters. If you wish to match the entire URL-path then use (.+) (to match 1 or more any characters). However, you can be more restrictive if you only want to match say 1 or 2 path segments? and it doesn't end with one of the endings specified in line 2 ...


0

This should do the trick RewriteEngine on RewriteCond %{REQUEST_FILENAME} !\. (css|js|png|jpg|php|svg|gif|webm|webp|eot|ttf|woff|woff2) RewriteRule ^([^/])/? index.php?url=$1 [L,QSA]


0

www.example.com/PageName:ArgumentValue1,ArgumentValue2 Since the ArgumentValues are part of the URL-path then any literal ? (question mark) should be URL encoded as %3F in the request. Otherwise, the unencoded ? indicates the start of the query string and effectively splits the URL in two - which is what is happening here. As a workaround, you can do the ...


2

Right now my .htaccess looks like this: If that is all you have in your .htaccess file then you can include some exceptions for the URLs you want to exclude before your existing rule that redirects. For example: # Prevent further processing if requesting a URL of the form # example.com/tt.php?xxx (where xxx can be any number) RewriteCond %{QUERY_STRING} ^\...


0

RewriteCond %{HOST_NAME} ^wwv([.]+)/?$ RewriteRule ^wwv([.]+)/?$ ./apex/app/$1 [L] This rule block will never match the stated URL for several reasons: The regex [.] (a dot inside a character class) matches a literal dot, not "any character". The character class negates the dots special meaning. So, [.]+ matches 1 or more dots. You should remove the square ...


0

To match the query string you need to use a condition that checks the QUERY_STRING server variable. The RewriteRule pattern matches against the URL-path only. So, to block (403 Forbidden) any request that contains a query string of x=y with mod_rewrite, you would do something like: RewriteEngine On RewriteCond %{QUERY_STRING} ^x=y$ RewriteRule ^ - [F] ...


1

mod_rewrite won't do you any good. The best option would be to configure your backend servers to serve the HTML with the correct base URL (/customerA/ instead of /application/). If this is not possible you can use ProxyHTMLURLMap from mod_proxy_html to rewrite the HTML before it is served. This will however add latency to your requests and load to your ...


Top 50 recent answers are included