I'm trying to make dynamic route for user pages. My route config looks next:
$route['id[0-9+]'] = 'user/index/$1';
On my Mac with MAMP it works fine. I can access to user's page with next uri (for example):
http://localhost:8888/MySite/id1
But the same uri doesn't work on the server and on my partner's windows-machine. I can access to page with user/index/1 and all another static routes works fine. I think there is a problem with regular expression, but I can't figure out what the problem is.
'id[0-9]+'
I guess you mean this.This will match id87 or id67723.
id[0-9+] will match id9+ or id8 or id+
Related
I migrated a clients site from a Movable Type site with posts that ended in ".php" to a WordPress site that ends in a slash "/". All my 301 redirects are working great but i found out from the client he has links in his websites Facebook page. Those links end in ".php?fbclid=InsertRandomParamsHere". What I need to do is replace the ".php" with "/" and the pages will redirect correctly while maintaining the Facebook tracking parameters at the end.
I've been using a regular expression for the 301 and here is what my regex looks like so far (I'm using Rank Math plugin for redirects):
The Source URL regex is:
^(.*)\.php(.*)
The Destination URL is:
https://www.beachwoodreporter.com/
What I get right now is, for an example link:
http://www.beachwoodreporter.com/music/you_turn_me_on_again.php?fbclid=IwAR37SDAQdPrxMqwHQEY6dcs5rle1Mt0b0WubR9dL8WbaX3zoKNqjW0J84p0
which should redirect to:
http://www.beachwoodreporter.com/music/you_turn_me_on_again/?fbclid=IwAR37SDAQdPrxMqwHQEY6dcs5rle1Mt0b0WubR9dL8WbaX3zoKNqjW0J84p0
is instead redirecting to:
http://www.beachwoodreporter.com/?fbclid=IwAR37SDAQdPrxMqwHQEY6dcs5rle1Mt0b0WubR9dL8WbaX3zoKNqjW0J84p0
so it's basically stripping out the slug portion of the URL:
/music/you_turn_me_on_again/
And the client has many links like this on their Facebook site trying to do one at a time is out of the question. All I need is to replace the ".php" with "/" and it should fix all these problems. Can what I want be done or should I tell the client I can't do it?
Image of the Rank Math regex settings:
I have a website and I'd like to redirect traffic based on a dynamic product ID in the url.
This I'm doing with help of Google Optimize Redirect Test. Setup is based on a Regex to actually fetch the Original page which I want to redirect to an other page.
https://domain.de/en/products/brand/product/a002p00001EuNgzAAF should redirect to https://domain.de/en/our-products/brand/product/a002p00001EuNgzAAF
How can i setup the regex so that I can use the 18 digit product ID as an identifier?
I alread tried to setup a regex like
https:\/\/domain\.de\/en\/products($|\?.*) plus trying to add the expression (\d{18}) but failed in putting it in the right position.
in my rich body text fields, when an internal page is used for a link, the url that gets attached to the a tag is "https//example.com/example", ie it's missing the colon and the link doesnt work. I get the error "https's server ip address could not be found".
any idea why it is doing this? thanks
Check the site record under Sites -> Settings. The hostname field should NOT contain https - i.e. it should be example.com, not https://example.com.
in case anyone else has this issue, it seems having more than one site in wagtail caused this. I had the default localhost site still on there, even after switching to a new production site configuration. deleting the localhost site fixed this.
I've created an Azure Static Website which works based on the Azure Blob Storage.
To be able to manage the automatic redirect from HTTP to HTTPs I created Azure CDN with Azure Verizon Premium subscription and I created an endpoint which
points to the URL of the static website. I followed the steps from this tutorial
If you hit the URL e.g.
https://blah.com/foo/
You will be automatically redirected to
https://blah.com/foo/index.html
This is because I set the Index document name to index.html in the Static website configuration panel.
What I want to achieve is to add the /index.html symbol to the very end of URL if it doesn't have an extension e.g.
https://blah.com/foo
https://blah.com/bar/foo
The expected result would be a redirect to:
https://blah.com/foo/index.html
https://blah.com/bar/foo/index.html
So my idea was to open the https://cdn.windowsazure.com/http/rules/default.aspx and try to create a new Rule; feature-> URL Redirect. In the TextBox near the Source label, I tried to specify the condition using Regex expression ^[^.]+$ which checks if the path contains a . If yes then it would mean the URL points to file with extension and the /index.html should be added to the end of URL. I think my Regex expression is wrong and should be different. Or maybe it is not the best way to achieve what I want?
Any ideas?
Cheers
So I tried almost everything and in the end, after adding this rule the Azure Static Webiste worked as expected:
Just further to this as I know it has an accepted answer but you won't need any redirect rule for index.html if you use a custom origin and use the static website's primary endpoint (will be something like .z8.web.core.windows.net/). For whatever reason, the CDN will treat that as a web server rather than a vanilla storage place.
My website is located at:
example.com/NAME/home.aspx?id=1
I want to make it so this url works without redirecting to original:
example.com/DIFFERENTNAME/home.aspx?id=1
Also, when hitting the first url, I want it to be redirected to the 2nd.
I have url rewrite module Tried modifying several inbound rules, but cannot make it to work.
You can use HTTP Redirect and reference link follows
https://www.iis.net/configreference/system.webserver/httpredirect