Questions tagged [rewritecond]
128 questions
0
votes
1 answer
apache .htaccess redirecting on one link, but not the other
I have this .htaccess file (this was the one that came with laravel. The only changes I made were to force https in the URL and the code shown below:
Options -MultiViews -Indexes
…
-1
votes
2 answers
Rewrite only if Image don't exists with .htaccess
How do I make RewriteCond+RewriteRule change site1.com/folder1 to site2.com/folder1, only if file in this directory don't exist.
For example: site1.com/wp-content/uploads/2014/03/image.jpg
If image site1.com/wp-content/uploads/2014/03/image.jpg …
![](../../users/profiles/218239.webp)
Orbital
- 105
- 1
- 4
-1
votes
1 answer
Block Wildcard User-agent
how can i write rewrite condition for wildcard user agents
here is the code I'm trying but doesnt work
RewriteCond %{HTTP_USER_AGENT} !*uTorrent* [NC]
RewriteCond %{HTTP_USER_AGENT} !*BitTorrent* [NC]
RewriteCond %{HTTP_USER_AGENT}…
![](../../users/profiles/204101.webp)
Niresh
- 103
- 4
-1
votes
1 answer
Apache rewrite rule infinite loop for subpage
I am trying to redirect toast.allthesmarts.com to toast.allthesmarts.com/dayone
RewriteEngine on
RewriteCond %{HTTP_HOST} toast.allthesmarts.com
RewriteRule ^(.*)$ http://toast.allthesmarts.com/dayone/ [L,R,QSA]
But this gives me infinite loop.…
![](../../users/profiles/55411.webp)
Stewie
- 537
- 2
- 7
- 17
-2
votes
1 answer
how would i create rule for a particular subdomain in uppercase? e.g XX.test.com
I am new to system admin side.
I need to create one subdomain with capital letters.
e.g our main URL will be test.com and one of our sub-domain will be SS
then instead of writing ss.test.com I want it to make SS.test.com
how would I achieve…
![](../../users/profiles/325093.webp)
user4988384
- 1
- 2
-2
votes
1 answer
apache: prepend a string literal to a TestString in a RewriteCond for mod_rewrite
So I can clearly do this:
RewriteCond %{REQUEST_FILENAME}\.php -f
But I cannot do this:
RewriteCond some_directory/%{REQUEST_FILENAME}\.php -f
Furthermore, this also fails:
RewriteCond prefix%{REQUEST_FILENAME} -f
Presuming of course those files…
![](../../users/profiles/307289.webp)
kristopolous
- 107
- 3
-3
votes
2 answers
Apache redirect to parent folder
I have a server pointing to
DocumentRoot /var/www/mysite
I would like to redirect all requests from
/var/www/mysite/folder/
to
/var/www/mysite/
I tried the following:
`RedirectMatch 301 /mysite/folder/(.*)…
![](../../users/profiles/229513.webp)
Guillaume Renoult
- 101
- 1
- 5
-3
votes
2 answers
Mod Rewrite code with out changing the url in address bar
I When I call http://www.mysite.in/abc/xyz it shoud show up http://www.mysite.in/abc/xyz/index.php but the url shout not change in address bar and it should work with out "/" in the address. Please any one help me with .htaccess code for apache…
![](../../users/profiles/189551.webp)
Sreekanth Sagar
- 39
- 1
- 14