33,157 questions
0
votes
0
answers
87
views
Weird behavior, htaccess work in both ways?
Request https://example.com/ , htacces file :
RewriteEngine On
RewriteRule ^$ /one
RewriteRule ^/one /two [R]
result I get https://example.com/two, remove the slash in the second RewriteRule
...
1
vote
1
answer
68
views
Apache returns 404 only when accessed through CloudFront (works fine via ELB directly)
Our web service is running on EC2 with Apache. We have the following setup:
Service A -> ELB -> Service B API
In this case, Apache on Service B shows in rewrite.log that the rewrite rule was ...
-1
votes
1
answer
64
views
Using RewriteRule to Server Content from One Page to Another [closed]
I'm using a CMS that doesn't allow me to change URL structure. It's find for 99.9% of my pages, but there are two that I'd like to have specific URLs. RewriteRule directives work for me in my ....
0
votes
1
answer
55
views
htaccess - rewrite cond/rule for parameters, but keep extra parameters
Current htaccess block :
# redirect "/search/location.php?state=x&city=x&name=x" to "/search/state/city/name/"
RewriteCond %{THE_REQUEST} \s/search/location.php\?state=(.+)&...
0
votes
1
answer
67
views
How to restrict write back feature to limited user in Power BI
I have a flow in Power BI using Power Automate. A person can write back to Dataverse, however I want to restrict write back feature to selected users, and all others can only view the data.
0
votes
1
answer
35
views
Get URL parameters and pass to external links
I have a new Wordpress site that I'm going to run Google Ads to. I need to be able to capture the click ID (&gclid=) and pass it to all external links from a post (for conversion tracking). This ...
1
vote
0
answers
42
views
htaccess subdomains to subfolders redirection error
the following htaccess redirected subdomains to subfolders with same names
subdomain mooga redirected to folder mooga
and we have subfolder blog in mooga
RewriteCond %{HTTP_HOST} ^((?!www\.)[^.]+)\....
0
votes
0
answers
37
views
htaccess rule run on files without folders
the following htaccess rule will redirect files without extension (contact) to (contact.php)
but it also run on folders
I want it to run only on files only and skip running on folders
RewriteEngine on
...
0
votes
0
answers
31
views
Rename get parameter via mod_rewrite
I want to rename specific http get parameter since application (NextCloud) changed it from path to dir and I want to preserve compatibility with old links.
Original URL was: https://example.com/index....
3
votes
1
answer
73
views
htaccess redirect block query string url
I'm working on a WordPress site that was apparently hacked some time ago. The intruder added a redirect plugin and has been happily redirecting traffic to spammy sites for a while. I removed the ...
1
vote
1
answer
75
views
rewrite rules, doc root, and anchors
What I'd like to do is make a directory act as root for a particular application. So resources linked as "/style.css" would actually load from "website.com/forum/style.css".
I have ...
1
vote
1
answer
79
views
How do I make Apache use 308 for DirectorySlash?
I am having an issue with redirects when posting form data to an Apache HTTP Server. When DirectorySlash is enabled, mod_dir is signaling an HTTP 301 to my client, which is causing the HTTP method to ...
3
votes
1
answer
202
views
htaccess block root folder but allow access to list of specified sub folders [closed]
I am trying to create .htaccess rules at the root of a client site to block traffic to a specific subfolder where WordPress is installed.
Here is my structure:
example.com
|--blog
|--.htaccess
|-...
0
votes
2
answers
170
views
Use RewriteRule to execute one specific non-PHP file as PHP
I have a single, specific non-PHP file on the server that must be executed as PHP. For the sake of example let's say it's a text file called test.txt and its contents are: <? echo 'hello world'; ?&...
1
vote
2
answers
65
views
Using a rewrite rule with regex on first 3 characters of a number doesn't work
I'm learning how to use a RewriteRule with Apache to rewrite the following URL /t/openstack/build/123456789987456214. To get the first three digits of the number and rewrite to a URL like /123/...