LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-11-2011, 07:20 AM   #1
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 229

Rep: Reputation: 30
apache rewrite rule


I have a rule:

RewriteRule ^/a/(book)(.*) /c/d/en/a/$1/$2 [L,PT]

if i type

url www.url/a/book/faq.html it goes to www.url/a/book/

if i type www.url/a/book//faq.html it works and loads source page

why so ?
 
Old 11-11-2011, 12:54 PM   #2
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
I'm sorry but I don't have any idea what you're trying to do with rewrite.

Can you explain yourself what you're trying to do, then help may come.
 
Old 11-11-2011, 11:44 PM   #3
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 229

Original Poster
Rep: Reputation: 30
here is more clarity .... for rewrite rule

source:
wwwsite/a/book/faq.html

destination:
wwwsite/d/en/a/book/faq.html

rule i placed:

RewriteRule ^/a/(book)(.*) /d/en/a/$1/$2 [L,PT]

if i type in browser

wwwsite/a/book/faq.html it goes to wwwsite/a/book/ (with no page found 404 error)

if i typein browser: wwwsite/a/book//faq.html it works and loads destination page (wwwsite/d/en/a/book/faq.html)

why does it working placing // double slashes ?
 
Old 11-14-2011, 01:36 AM   #4
sunlinux
Member
 
Registered: Feb 2006
Distribution: RHCL 5
Posts: 229

Original Poster
Rep: Reputation: 30
its closed space between $1/S2
 
Old 11-14-2011, 07:27 AM   #5
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
probably if you leave out the $2 to read:
Code:
RewriteRule ^/a/(book)(.*) /d/en/a/$1 [L,PT]
it may work

I don't know really.

good luck...
 
Old 11-14-2011, 08:06 AM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Is your RewriteRule within a Directory block?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache rewrite rule sunlinux Linux - Newbie 10 11-11-2011 06:01 AM
apache rewrite rule sunlinux Linux - Server 2 09-25-2011 03:03 PM
Need help with apache Rewrite Rule? your_shadow03 Linux - Newbie 1 01-21-2010 08:12 AM
Linux Apache Rewrite Rule jon_k Linux - Software 1 06-10-2009 03:09 AM
Apache rewrite rule help kinetik Linux - Software 1 11-05-2007 12:18 PM


All times are GMT -5. The time now is 06:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration