Questions tagged [regex]
The regex tag has no usage guidance.
45
questions
0
votes
0
answers
30
views
Regex redirect AMP pages after using 3 AMP plugins 4 years previous
I'm having problems redirecting several cases of amp to the canonical non-amp urls. Over the years, I tried different AMP plugins. Namely the official WordPress AMP, AMPforWP, and AMP NINJA.
It's been ...
2
votes
2
answers
51
views
Regex / Regular Expression for finding duplicate URL directories in Screaming Frog SEO Spider
While analysing a website with the Screaming Frog SEO Sider I've seen a problem of some pages containing duplicate URL directories.
To fix this problem I need to know which URLs this affects.
So I ...
1
vote
0
answers
20
views
Can I RedirectMatch w/ regex to redirect multiple individual pages with similar url patterns?
Goals is to use one RedirectMatch statement to redirect 50+ pages with slightly changing names.
Examples: https://www.example.com/galler-prime-alpaca-heathers-mermaid.shtml
https://www.example.com/...
1
vote
0
answers
40
views
Google Analytics (Universal): Regex Filter on report for multiple pages
I'm setting up an Analytics report and want the data from two pages combined. I don't want the data from any of the subpages or parent pages included.
Say that the pages are Trier Blog and ...
1
vote
2
answers
128
views
First website and losing hope with .htaccess and regex. I want to manipulate multiple things
Last time I used regex was to manipulate some BGP routes and it didn't go well. I don't expect anyone to write me a full .htaccess file, but: in which order would you write the lines? Should there be ...
3
votes
0
answers
65
views
On Google Sheets Google Analytics Add on, how can I filter by page?
I am using the Google Analytics Add on in Google Sheets.
I need to add a filter that enables my report to only show URLs containing the word "blog"
The blog pages are not in a directory, e.g....
4
votes
1
answer
693
views
Modify rewrite rule to match ONLY directories, NOT directories AND files
I have the following rule in my .htaccess file:
RewriteRule ^[^/].*/(dir1|dir2|dir3)(.+) $1$2 [QSA]
It works great for the directories except sometimes it conflicts with files.
How can I modify this ...
1
vote
0
answers
35
views
Regex to Filter Custom Date Dimension
I am hoping to get the regex formula for a custom dimension we have set up in our Google Analytics for publish date. I want to filter the data so I can see publish dates only 90 days before today to ...
2
votes
1
answer
332
views
Non-ascii characters in RewriteRule :alpha:
I have RewriteRule ^([[:alpha:]]+)$ do-something.php?parameter=$1 and it works for URLs like .../Virtanen. For .../Mähönen I can use ([ÄÖäö[:alpha:]]+, but that of course fails for, say, .../Vadén. ...
1
vote
1
answer
81
views
Generate UTM parameters from a url parameter for Google Analytics (WP Hosting)
I am generating QR Codes and to keep it as clear as possible, I want a short URL, then expand to a full address + UTM or at least have Google Analytics understand.
QR Code payload:
https://example.com/...
3
votes
1
answer
2k
views
Why Doesn't "location /" Match Every URI in Nginx
In Nginx, according to this question's answer
https://stackoverflow.com/questions/59846238/guide-on-how-to-use-regex-in-nginx-location-block-section
when using no modifier between the location ...
3
votes
1
answer
2k
views
Regex to match a specific page path in Google Analytics based on what it starts with and what it ends with
I need to come up with a regular expression that matches all page paths that:
starts with /google+redesign/ AND
ends with /quickview.
What would a correct regex combination look like?
5
votes
1
answer
323
views
How to make a graph in Google Data Studio showing specific url parameters that were queried in my site?
I have a search page on a hotel property website that can have up to 12 parameters in the url. Note that sometimes it may have none of these parameters. The parameters are all for optional ...
3
votes
1
answer
487
views
How are slashes added between htaccess mod_rewrite variables
I was looking at two different variants of redirects:
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L,R=301]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
And noticed that in the first ...
2
votes
1
answer
151
views
Google Analytics: Filtes query include only homepage with subdirectory
I want to create a Regex query to filter only the homepage with some subcategories.
I have multi-language home pages with the this structure:
mail.example.com/en/
example.com/
example.com/de/categoy/...
3
votes
1
answer
283
views
Rewrite wildcard rule to redirect images that works with HTTP, HTTPS and Firefox HTTPS-Only mode
This set of rules causes the nolinks.jpg image to appear if anyone tries to link directly to an image from a remote site. It is working well but with the latest Firefox, the browser is forced to ...
0
votes
0
answers
105
views
How Can I Use Screaming Frog to Find Specific Text Using RegEx or XPath?
I'm using Screaming Frog to crawl my site. I created a custom search to look for "myterm". When i crawl the site, the reports shows how many occurrences of "myterm" are shown on ...
1
vote
1
answer
480
views
.htaccess url rewrite remove 2 id
Is it possible to delete 2 parameters ID of the url & just show the number. Currently i have url like this:
http://localhost/photo_gallery/public/product_configurator.html?prometheus_id=10082&...
1
vote
1
answer
290
views
Url changing with htaccess
I have a web presentation with some typical url adresses. Now I need to add a rewriterule for a different languages, examples:
domain/club -> do not change
domain/club/path -> do not change
...
2
votes
1
answer
2k
views
301 redirect with regex: how to match any file at top domain level (not in a subdirectory)?
I need to redirect URLs of all .dmg files at domain's top level to specific folder.
By way of example:
http://example.com/file.dmg to http://example.com/downloads/file.dmg
I can't hard code the domain ...
0
votes
1
answer
41
views
Setting up a Destination Goal in Google Analytics using Regex
I want to set up a destination goal in GA to determine when a user reaches the end of a flow, or basically has completed a process.
The problem, the URL changes depending on the activity of the user ...
2
votes
1
answer
188
views
htaccess Redirect Using Regex
I have 2 redirects that work fine:
Redirect 301 /namedeal/ca_domain_name.php /namedeal/cheap_domain_name.php
Redirect 301 /namedeal/ws_domain_name.php /namedeal/cheap_domain_name.php
I want to be ...
3
votes
1
answer
1k
views
Hide the subfolder from appearing in url
I want to move from www.example.com/_/randomfolder to example.com/randomfolder. It should acces the contents from /_/randomfolder but should show example.com/randomfolder.
What I have tried:
Trial 1
...
2
votes
1
answer
206
views
set header 410 for random generated folder path
I have thousand of error URL with patterns like this
https://example.com/feeds/74750882288885xxx/comments/default
where 74750882288885xxx is a random number, I need help to set this URL to be 301 ...
1
vote
0
answers
249
views
Multiple URL's in Google Analytics Goals Funnel Step
Have a landing page with 3 packages: 1 of the product, 3 of the product, 6 of the product, each option has their own checkout URL but all will have /thank-you in the URL once purchased.
So they all ...
3
votes
1
answer
46
views
Redirects for both paths and posts in the path
I rarely need to do redirects and when I do they're usually simple. This time I'm trying to do something a little more advanced and I'm stumped. Regex is hard :)
This is a WordPress site and I'm ...
1
vote
1
answer
3k
views
htaccess redirect based on referrer URL string
I have a 3rd party who POST's to a specific page on my website. They post a file and my site does some wizardry with the contents of that file.
The request URL would be for example https://example....
1
vote
3
answers
214
views
How get Google Analytics report of selected pages using an regex?
We want to make a report of visitors of a selected set of pages.
So we use "Behavior" > "Site Content" > "All Pages".
We fill in part of the pagenames, so FR_PLT* for pages FR_PLT_01, FR_PLT_02 and ...
0
votes
1
answer
169
views
regex interpretation for a json additional properties
I aim to create a condition for additional properties in JSONschema that handle any schema (all the types such as object|array|Boolean|string|number|null) and if the type is a string then it could be ...
5
votes
3
answers
3k
views
301 Redirects what does ([a-z]+)-(.*) and ([0-9]+)-(.*) mean
I just checked an .htaccess file with some custom redirects. There are two redirects I don't fully understand:
RedirectMatch 301 ^/news/([0-9]+)-(.*) /blog
RedirectMatch 301 ^/news/([a-z]+)-(.*)/$ /...
1
vote
1
answer
325
views
regex on htaccess not working as expected
I have this rule on my .htaccess that doesn't work as I would expect:
RewriteRule ^/rg$ /download/file_1.pdf [NC,L]
I would like to redirect all the requests from www.example.com/rg to download this ...
4
votes
1
answer
76
views
Robots.txt allow directory root while disallowing all deeper URLs
I would like to allow a path and disallow everything else in the directory.
User-Agent: *
Allow: /example/
Disallow: /example/*
Will this work? If not what would be a better way of doing this?
0
votes
1
answer
1k
views
Google Analytics Funnel Goal Funnel using RegEx
I've created goals using Google Analytics to track the number of pageviews and goal conversions. I have 2 goals in mind.
First Goal: User made an appointment without going to other sites > Thank you ...
2
votes
1
answer
6k
views
IIS URL Rewrite: Pattern starting with forward slash never matches
I am using IIS URL Rewrite and this one has stumped me.
I am redirecting a URL with specific subfolder to a new URL.
e.g. https://myapp.example.com/customsite1 redirected to https://newsite1-myapp....
5
votes
2
answers
3k
views
How could I forcibly output the default 403-forbidden error page when http://example.com/not_found is requested?
This is my first question on StackExchange so bear with me, here is a brief breakdown of my current setup:
Two different domains, two different TLDs (.dk and .de) on the same hosting plan
for the ...
1
vote
0
answers
211
views
How to create RegEx table in Google Tag Manager that finds a word in the URL of ClickURL?
How do I create RegEx table that find a word in the URL of ClickURL?
I want to that the RegEx table will check if the word "online" exists in the ClickURL - if so, the input will be "online".
2
votes
1
answer
905
views
.htaccess redirect strip old system content from end of URL
Looking to redirect all URLs which look similar to this:
https://www.example.com/discussion/topix/random-page-title.133760/posts/1255466/rate?rating=13&_Token=78139%2C1464617730%...
2
votes
1
answer
112
views
Redirect 301 from old domain to a new one affect google rank
I did the redirect from my old domain store to a new domain using 301 rules on .htaccess as simplified below:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{THE_REQUEST} /store/catalogsearch/...
1
vote
1
answer
89
views
REGEX with RewriteRule
This regex is confusing. I want to know its exact meaning. I try to explain by myself. I hope I won't get an error understanding. Please kindly correct my thoughts.
RewriteRule "(^|/)\.(?!well-known)"...
3
votes
0
answers
50
views
Filtering Google Analytics pages for Uppercase characters
I'm trying to see if users have accessed URLs with uppercase characters.
I have gone into Behavior>Site Content>All Pages and am attempting to filter using Regex.
However, my syntax is not ...
1
vote
1
answer
113
views
Google Analytics traffic filter setup (regex needed?)
I need help in setting up a traffic filter on Google Analytics. I want to include traffic from the following URI:
www.example.com/cc/ll/store/
store.domain.com
Traffic from different URIs must be ...
2
votes
2
answers
2k
views
combine trailing slashes in analytics
Inside my analytics profile, I have to aggregate data from URLs when they are on separate rows because example.com/path is different from example.com/path/. This is a huge usability headache, so I ...
2
votes
0
answers
1k
views
Google Tag Manager - matching dataLayer Variables using regex
A number of pages on the site have a custom field that contains a word or a phrase (industry market segment) that get displayed in my dataLayer. I am then using that market segment variable to trigger ...
3
votes
1
answer
165
views
Is this literal or code in the .htaccess file?
Background: Recently, a business acquaintance contacted me because of strange behavior on his website. As may be expected, I found that the site was compromised.
One of the signs of the compromise ...
1
vote
1
answer
117
views
Modify existing htaccess rewrites to not match particular URLs
Trying to rewrite only particular URL's, for example:-
(1) I want to rewrite:-
http://www.example.com/keyword-1
http://www.example.com/keyword-1/sub-keyword
http://www.example.com/keyword-1/?p=50
(...