LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-23-2005, 04:12 AM   #1
rincewind
Member
 
Registered: Mar 2004
Posts: 32

Rep: Reputation: 15
Apache redirects?! How


Hello,


Is there possible to redirect an URL in apache to another url..

Lets say that i got the url trail

/demo/mysite/pic/58.jpg

and want to redirect all of the 58.jpg to
/demo/mysite/?showdbimage=58

/demo/mysite/pic/X.jpg
should go to
/demo/mysite/?showdbimage=X


And make that apply to all of my sites under /demo

?
Is this possible to do from a .htaccess file (I now NOTHING about thes .htacces files)..=)


Thankful for help,
Regards..
-- Rincewind
 
Old 02-23-2005, 06:40 AM   #2
linuxxed
Member
 
Registered: Feb 2004
Posts: 273

Rep: Reputation: 30
Have you looked at mod_rewrite apache module?

http://httpd.apache.org/docs/mod/mod_rewrite.html
 
Old 02-23-2005, 07:35 AM   #3
rincewind
Member
 
Registered: Mar 2004
Posts: 32

Original Poster
Rep: Reputation: 15
Yeah.. Thanks.. That helped a lot!!!=)

Another question though...


if I have in one of the dir a .htaccess file that looks like this:
Code:
RewriteEngine On
RewriteRule ^/pics/(.*)\.jpg$ /?showdbimage=$1
it deos not work..
Any suggestions?

Im working in www.foo.bar/demo/mysite/
Im thinking it has to do that im not in the root directory www.foo.bar..?

Does anyone have any hints for me on how to fix this??
Thanks..
-- Rincewind
 
Old 02-23-2005, 02:43 PM   #4
linuxxed
Member
 
Registered: Feb 2004
Posts: 273

Rep: Reputation: 30
Check if you've got "AllowOverride None" in your httpd.conf. If yes then it will ignore .htaccess.

Increase log level - think it is RewriteLogLevel. Check logs to see how it is rewriting and why ..
 
  


Reply



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
virtual host redirects with mod_rewrite sqn Linux - Software 1 10-11-2005 08:47 PM
Redirects in Zope (ZMS) nyk Programming 0 09-06-2005 05:08 AM
Apache: Request exceeded the limit of 10 internal redirects guarriman Linux - General 1 01-26-2005 08:06 AM
ICS and 302 redirects don't mix dataangel Linux - Networking 1 08-22-2004 02:36 PM
Linux named domain redirects? Nic-MDKman General 2 02-04-2004 09:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:40 PM.

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
Open Source Consulting | Domain Registration