Apache :: Mod Rewrite Rule To Prevent Access To Specific Page?

Jun 25, 2013

This is the mod_rewrite rule I'm trying to create. I am very new to Apache admin. Here's the issue:

I have 3 vhosts running on my HTTPD Apache 2.2.24 server: Server1, Server2, Server3. Each vhost is connected to a Weblogic application server. We are trying to prevent access to the Example.portal page on each application server.

So the URLs I'm trying to rewrite are:

- Server1.domain.com/PortalWeb/Example.portal
- Server2.domain.com/PortalWeb/Example.portal
- Server3.domain.com/PortalWeb/Example.portal

So, I would like to redirect the above URLs back to the 'root' of the website. ie: server1.domain.com. Here is my rewrite rule:

RewriteRule ^(.*)/Example.portal$ http://$1 [NC]

So, the rule is matching correctly to URLs that contain Example.portal, however the back reference from (.*) does not seem to map to $1.

View 6 Replies


ADVERTISEMENT

Apache :: Mod Rewrite Rule To Disallow Direct Access To Files From Some Directory

Oct 26, 2014

in wordpress is wp-includes folder, i dont want anyone just execute file from this directory so it just serve wordpress not any malicious file be executed from there,

so i added this rule into /wp-includes/.htaccess:
RewriteRule ^(wp-includes)/.*$ ./ [NC,R=301,L]

View 2 Replies View Related

Apache Rewrite Rule - 404 Error

Apr 29, 2013

I need two rules in apache to work

RewriteRule ^([^/]*).html$ index.php?page=$1 [L]
RewriteRule ^([^/]*)/([^/]*).html$ index.php?pnumber=$1&page=$2 [L]

First one rule does work and /index.php?page=something redirect to /something.html

Second rule does not work /index.php?pnumber=1&page=something need to be /1/something.html

But when make this link i got 404 error the request url not found.

Where is error, an how i can make to second rule work too?

View 1 Replies View Related

Apache :: Rewrite Rule For OWASP XSS Conventions

Aug 13, 2014

I need to implement prevent XSS attacks by using apache rewrite following rewrite rules for all urls of the domain.

Converting < and > to < and >
Converting ( and ) to ( and )
Converting # and & to # and &

& --> &
< --> <
> --> >
" --> "
' --> '

View 2 Replies View Related

Apache :: Rewrite Rule Does Redirect Rather Than Proxy

Oct 28, 2014

I just installed httpd-2.4.10-win32 and I can't make mod_rewrite to work :

What I'd want is a proxy to receive a print.xxxx.com/appl uri and forwards to appl.serveur.xxxx.com:8080/streammaster

I do

RewriteCond %{HTTP_HOST} print.xxxx.com
RewriteRule /appl/ http://appl.serveur.xxxx.com:8080/streammaster [P]

and I get a redirect : 192.168.250.50 - - [28/Oct/2014:14:55:19 +0100] "GET /appl/ HTTP/1.1" 302 - mod_proxy is loaded and works of course.

I've tried lot of variations (it works the same in a virtual host without rewritecond) to no avail.

View 4 Replies View Related

Apache :: URL Rewrite Rule Without Permanent Redirect

May 10, 2014

I am new to wordpress; I want a url rewrite rule for my htaccess. I want when a user visits www.domain.com/services/manu/ the url on the address bar should be www.domain.com/services/. I don't want a permanent redirect.

View 2 Replies View Related

Apache :: Writing Htaccess Rewrite Rule?

Feb 21, 2014

I'm trying to change url structure so instead of /default/category/product.html it would show /category/product.html

With this line I've managed to do it on my personal blog

RedirectMatch 301 /default/(.*) //$1

But when I've implemented it on a customers Magento site it started showing double slashes like this //category/product.html and the whole template just collapsed .

View 17 Replies View Related

Apache :: HTAccess Won't Process Rewrite Rule Despite Many Attempts

Apr 1, 2015

It should be a straight forward change. [URL] .... does not redirect to [URL]...... It simply tries to load /denver-cars/ and denver-cars is in the URL. Am I missing something here? I have tried moving it up and down the list of rules and have tried numerous types of flags to no avail. Everything else in the htacess works fine with out the line:

RewriteRule ^/(.*)-cars/ /newcars-in-$1/ [NC,R=301,L]

Here is my htaccess:

Options +FollowSymlinks
RewriteEngine on
RewriteBase /
# Force www
# Redirect google index dir's to new dir
RewriteRule ^/(.*)-cars/ /newcars-in-$1/ [NC,R=301,L]

[code]....

View 1 Replies View Related

Apache :: HTAccess And Rewrite Rule - Show Existing Images

Mar 8, 2015

I'm using .htaccess to show existing images instead of images which does not exist.

RewriteBase /images/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)_(.*)1200x900.jpg$ esittely_$21200x900.jpg
RewriteRule liiga1200x10.jpg esittely1200x10.jpg
RewriteRule liiga670x10.jpg esittely670x10.jpg [L]

Everyting works fine if an image does not exist.

But if an image does exist, the second RewriteRule
RewriteRule liiga1200x10.jpg esittely1200x10.jpg
will be used.

Why is that so? How could I modify my code to prevent that? 

View 2 Replies View Related

Apache :: Create Rewrite Match 301 Rule To Push Long URL To Shortened URL Permanently?

Jan 30, 2013

I am using the following mod_rewrite rule for shortened SEO friendly links: RewriteRule ^blog/([^/]*).html$ /blog/blog.php?pid=$1 [R=301,L]

For Google SEO reasons, will the shortened rewritten link created from above be the permanent link, from the R=301? Even though the longer link is still functional? Or, do I need to create a rewrite match 301 rule to push the long URL to the shortened URL permanently?

View 5 Replies View Related

Apache :: Crafting HTAccess Rule That Looks URL Of Visiting Page

Sep 28, 2013

I am new to apache, and really terrible with regular expressions.

How to craft an htaccess rule that looks a the URL of the page you are visiting, and redirects HTTPS to the same URL in HTTP if the URL contains a certain text string (in the case the word "products")...

View 1 Replies View Related

Apache :: IP And Page Specific Redirect?

Feb 19, 2014

I'm trying to get code to go in a .htaccess file that when a specific IP tries to get a specific page, he/she is redirected to another page.

I have tried many variants of this code below ...

Code:

RewriteEngine On
RewriteCond %{REMOTE_ADDR} ^12.345.678.90$
RewriteCond %{REQUEST_URI} /requested-page.html$
RewriteRule .* /redirect-to-this-page.html [R=301,L]

... and nothing works. My webserver gets hosed, and my otherwise working system gives me an error when I try to get a page from it. I am, by the way, using Mac 10.6.8, with Apache 2.2 on both server and client.

What will work??

View 6 Replies View Related

Apache :: Redirect Any Specific Page Of Site To Homepage

Feb 19, 2015

How do i redirect URL: example.com/page1 to example.com..i want to redirect any specific page of my site to homepage.

View 3 Replies View Related

Apache :: Prevent Access To Files

Mar 6, 2014

When a user enters the whole url to a file on the webserver he/she can view this file. I want to prevent this and only allow access to the files from within the application (under apache). How can I do that? I already tried:

<Directory /var/www/html/folder/files>
order deny,allow
allow from localhost
</Directory>

This works BUT the file also isn't viewable from within the application anymore.

View 1 Replies View Related

Apache :: Restrict Access To A Set Of IP In Specific URL

Jan 18, 2014

I have Apache 2.2 installed on my Unix Server and have a couple of Application servers running each of them having similar Document Root.

For example, The URLS will look like below

https://my-test1.com/demo/index.html
https://my-prod1.com/demo/index.html
https://my-qa1.com/demo/index.html

The directory folder looks like

/myapp/my-test1/demo/index.html
/myapp/my-prod1/demo/index.html
/myapp/my-qa1/demo/index.html

I would like to restrict access to the above prod1 URL for a specific set of IP's. How can I achieve this.

View 1 Replies View Related

Mod Rewrite Rule

Feb 14, 2007

I have few subdomains pointing to a directory (using dedicated ip an A record)

I need the following rewrite rules:

[url]--> [url]
[url]--> [url]
[url]--> [url]

How can I do this?

View 3 Replies View Related

Rewrite Rule

Aug 7, 2007

I have to write Rewrite rule at .htaccess file

[url]
goes to
[url]

View 3 Replies View Related

Rewrite Rule

Jul 9, 2007

How to rewrite a url for example. I purchased ssl for example.com and when i take [url], it gives ssl domain mismatch error.

ie i want to rewrite
[url]

View 1 Replies View Related

Apache :: Possible To Make Some Rewrite Function To Add Some Text On URL From Access?

Jan 17, 2015

I am a beginner in Apache Web server, whether it is possible to make some rewrite function ( or something similar ) to add some text on url from access ?

For example URL....

I need some function in httpd.conf where in SetHandler server-status ( URL... ) can see users who are connected like /testurl username=someusername:somepassword ?

I did link http://someusername:somepassword@domen.com/testurl?username=someusername:somepassword but some users delete from ?username=someusername:somepassword from link and I have a problem to monitoring that lines ! 

View 3 Replies View Related

Apache :: How To Restrict Access Via IP Address For Specific Webpages

Apr 17, 2014

I'm using Concrete5 CMS to create a website. This CMS creates/manages all its webpages in a mySQL database. Thus, there is no physical folder associated with each webpage, so I can't simply create an .htaccess file and place it in the directory tree in the right sub-folder to restrict access for that sub-folder and all folders it contains.

I have one .htaccess file located at the root level (e.g top-level folder for the website).

QUESTION 1: I need place in this top-level .htaccess file to (1) restrict access to only two specific IP addresses that I can specify (blocking access to all other IP addresses), and (2) specify the URL addresses that I wish to apply this rule to?

For example, let's say my website is [URL] ....

And I want to restrict access to the [URL] ....

and my .htaccess file is located at

/home/myname/public_html/conc/.htaccess

What code can do that?

View 1 Replies View Related

Apache :: How To Deny Access To Specific File Using HTAccess

Jun 21, 2014

I would like to deny access to .log

View 1 Replies View Related

Convert .htaccess To Lighthttpd Rewrite Rule

Jun 5, 2007

How do I go about converting the follow .htaccess file

Code:
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_FILENAME} /blogs/(clientscript|images)/
RewriteRule ^(.*)$ $1 [L]

RewriteRule ^blogs/([-a-z0-9] )/([-a-z0-9] )-([0-9] )/comment-([0-9] ).html blogs/viewblog.php?username=$1&entrytitle=$2&entry=$3&c=$4 [QSA,L]
RewriteRule ^blogs/([-a-z0-9] )/([-a-z0-9] )-([0-9] )/feed/ blogs/syndication.php?entry=$3 [QSA,L]
RewriteRule ^blogs/([-a-z0-9] )/([-a-z0-9] )-([0-9] )/ blogs/viewblog.php?username=$1&entrytitle=$2&entry=$3 [QSA,L]
RewriteRule ^blogs/([-a-z0-9] )/category/([-a-z0-9] ).html blogs/viewblog.php?username=$1&categorydata=$2 [QSA,L]
RewriteRule ^blogs/([-a-z0-9] )/([0-9]{4})/([0-9]{1,2})/ blogs/viewblog.php?username=$1&month=$3&year=$2 [QSA,L]
RewriteRule ^blogs/([-a-z0-9] )/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2}).html blogs/viewblog.php?username=$1&month=$3&year=$2&day=$4 [QSA,L]
RewriteRule ^blogs/([-a-z0-9] )/archive.html blogs/viewblog.php?username=$1&displaymode=archive [QSA,L]
RewriteRule ^blogs/([-a-z0-9] )/feed/ blogs/syndication.php?username=$1 [QSA,L]
RewriteRule ^blogs/([-a-z0-9] )/ blogs/viewblog.php?username=$1 [QSA,L]
to work with lighthttpds rules?

View 2 Replies View Related

Apache :: VirtualHosts - Can't Access Some Alias Page

May 9, 2013

I can't access to some alias page by URL....

(getting 403 - Forbidden) but i can by https - [URL] ....

Code:

<VirtualHost 10.7.10.10:80>
ServerName mydomain.com
ServerAlias www.mydomain.com
DocumentRoot "c:/Apache24/htdocs"
Alias /static "d:/static"

[Code] .....

Code:

<VirtualHost 10.7.10.10:443>
DocumentRoot "C:/Apache24/htdocs"
ServerName domain.com
ServerAlias www.domain.com
SSLEngine on

[Code] .....

What could be wrong as the config is exactly the same for both VirtualHosts

View 3 Replies View Related

Apache :: How To Redirect Specific Useragent On Specific URLs

May 20, 2015

I have question: How to redirect specific useragent on specific URLs to specific URLs in .htaccess [Question]

E.g.:

I want to redirect 301 with conditional:

Code:
useragent: Firefox
from my url1: domain[dot]com/old-url1/
from my url2: domain[dot]com/old-url2/

to

Code:
to new url1: in my url1: domain[dot]com/new-url1/
to new url2: in my url1: domain[dot]com/new-url2/

I create this in my .htaccess but not work

Code:
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} googlebot [NC]
RewriteRule ^/?this-is-url/?$ domain[dot]com [L,R,NC]

View 1 Replies View Related

Apache Rewrite ==> Lighttpd Rewrite

Jul 24, 2008

I dowload a scripts with a .htaccess file

Code:
DirectoryIndex index.php
RewriteEngine On
RewriteRule ^link/([0-9]+)[/]*$ /redirect.php?id=$1
RewriteRule ^link/([a-zA-Z0-9]+)[/]*$ /redirect.php?tag=$1

I want to convert it to lighttpd rewrite rules, urgent, also I can't contact with the scripts author,

View 0 Replies View Related

Plesk 11.x / Linux :: How To Know If Nginx Served A Specific Page

Jun 3, 2014

I have setup Nginx to serve static pages. I cache some pages and therefor they are static and should be served by Nginx. Now, how can i check if a specific page actual was served by Nginx and not Apache?

View 1 Replies View Related

Apache :: Redirect Some HTM Page To WordPress Page Without Path And Query String

Jan 5, 2015

I want to permanent redirect some .html page from subdomain to main domain WordPress page,Redirect permanent /cat/FSBO76.URL....

View 1 Replies View Related

IIS 5 - Cant Access Page From IE7 But Can Access From Firefox

Feb 20, 2008

I found a great little app called ID Shutdown Manager which bascially lets you do stuff like wake on LAN, Shutdown, Log Off etc.

The App also has a cgi script which you can call from a web server so you get a web interface to the program.

This is exactly my reason for getting the app as I just wanted to host a web page where I could login from the internet and wake on lan my media PC.

Ok so...

The app gives you all the iis or apache setup instructions and tells you to place the cgi script which is actually a .exe into the scripts folder and then enable basic authentication for it.

Done.

So if I navigate to <SERVER>/scripts/sdmancgi.exe its supposed to give me a user / pass prompt and then when login successful I see the app and can wake on lan etc.

ok I have got this to work

on the actual machine where server is running I can access it in IE7 by localhost etc.. and it works

However when I try to access from another PC in my lan by typing <SERVER>/scripts/sdmancgi.exe I get a nice little message saying the content cannot be displayed you may require to insall a program or something to display it.

If I try to access the page from firefox on same remote PC, it works!

I can also access page from outside my LAN, it works on my N95 browser.

Also I have had friends try it from firefox from the Internet and they say it works as well.

Forgot to mention I am running on port 8081 as I already have other servers running on 8080 and 80 (one is my router and the other server installed itself from setup.exe and I dont know what server its using)

I have also tried latest apache server as well as some other free one. Both have the same effect. Ok in firefox, not in IE.

One would think its a problem with the cgi file not compatible with IE7 however, I even tried to go to default page setup in IIS <SERVER>:8081 and I get the same message. So at this point the server hasnt even tried to access CGI or prompt for Basic Authentication.

I tried googling and not much luck. I read something about CSS and when I view source of failed web page from IE7 it mentions something about CSS so dont know if this is it?

View 4 Replies View Related

Does The Use Of Partitions Prevent Hackers From Getting Access To The Linux Server

May 7, 2007

Does the use of partitions prevent hackers from getting access to the entire Unix server?

View 2 Replies View Related

How Can I Give A Customer Access To His Specific Domain On Godaddy

Apr 14, 2008

I have an account on godaddy, with more than 20 domains registered and well, so far i have been in charge of the updates of these domains and the websites they represent. But now I have this customer who is asking me to have access to his specific domain so he can upload files by him self, the thing is that i dont have a clue of how to do it. I tried to create a new account in godaddy for this customer and tried to transfer this domain into his account and I was not allowed to. I cannot give him my username and psw cause he wont only have access to his website but all those i have registered under my account. I will really appreciate some advises to help me work this out.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved