Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Apache Rewrite Rules
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Alpesh Bhavsar  
View profile  
 More options Nov 2 2012, 2:20 am
From: Alpesh Bhavsar <alpeshbhavsar19...@gmail.com>
Date: Fri, 2 Nov 2012 11:50:04 +0530
Local: Fri, Nov 2 2012 2:20 am
Subject: Apache Rewrite Rules

Hi All,

I need help to create apache rewrite rule. My requirement is as given below.

Source URL: http://localhost/directory/file_name_1

Destination URL: http://localhost/file-name-1.html

Note: Above requirement is not for static URL, but there would be any other
word instead of "directory" and "file_name_1".

- "directory" word should be removed in new redirected URL
- underscore ( _ ) should be replaced with Hyphen ( - )
- "file-name-1" should be ended with .html extension.

I appreciate your reply.

Thank you.
Alpesh Bhavsar


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alpesh Bhavsar  
View profile  
 More options Nov 2 2012, 3:45 am
From: Alpesh Bhavsar <alpeshbhavsar19...@gmail.com>
Date: Fri, 2 Nov 2012 13:15:23 +0530
Local: Fri, Nov 2 2012 3:45 am
Subject: Re: Apache Rewrite Rules

Hi All,

Its done. I have applied below rules.

        RewriteCond     %{REQUEST_URI}  ^/(.*)/([^_]*)_(.*)$
        RewriteRule ^(/?.*/[^/]*?)_([^/]*?_[^/]*)$ $1-$2      [N]
        RewriteRule ^(/?.*/[^/]*?)_([^/_]*)$ $1-$2.html      [R=301]
        RewriteRule ^/(.*)/(.*)$        $2                           [R,L]

On Fri, Nov 2, 2012 at 11:50 AM, Alpesh Bhavsar <


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ElectroMech  
View profile  
 More options Nov 6 2012, 12:13 am
From: ElectroMech <electrom...@electromech.info>
Date: Tue, 6 Nov 2012 10:43:40 +0530
Local: Tues, Nov 6 2012 12:13 am
Subject: Re: [VGLUG] Re: Apache Rewrite Rules

Hi,

I appreciate, it is always a good practice to post the solution to group.

On Fri, Nov 2, 2012 at 1:15 PM, Alpesh Bhavsar <alpeshbhavsar19...@gmail.com

> wrote:
> Hi All,

> Its done. I have applied below rules.

>         RewriteCond     %{REQUEST_URI}  ^/(.*)/([^_]*)_(.*)$
>         RewriteRule ^(/?.*/[^/]*?)_([^/]*?_[^/]*)$ $1-$2      [N]
>         RewriteRule ^(/?.*/[^/]*?)_([^/_]*)$ $1-$2.html      [R=301]
>         RewriteRule ^/(.*)/(.*)$        $2                           [R,L]

I suggest other to follow the same, post the final solution and conclusion,
will help to the community.

Thanks and Regards.
--
--
Nilesh Vaghela
(RHCSA RHCE)
ElectroMech Corporation
Redhat Channel Partner and Training Partner
302, New York Plaza, Opp Judges Bunglow, Bodakdev, Ahmedabad
22, 1st Floor, Vardhaman Complex, Subhanpura , Baroda.
www.electromech.info


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »