mod_rewrite in .htaccess

I wrote this below in .htaccess file under directory /cgi-bin/AD_cla
It doesn't work with mod_rewrite. Need to do more in server?
I don't have a access to change mode in this server. And Does file .htaccess  work in directory cgi_bin?

Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule cla/(\.*)/(\.*)/(\.*)/(\.*)/(\.*)/(\.*)/(\.*)/(\.*)/$ /cgi-bin/AD_cla/cla\.cgi?$1=$2&$3=$4&$5=$6&$7=$8
tilmesAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ahoffmannCommented:
> And Does file .htaccess  work in directory cgi_bin?
if it is configured to do so, yes.
If it is not configured, then you're losst, means you need to do authetification in your CGI itself.
0
tilmesAuthor Commented:
.htaccess  file dosn't work in either in directory cgi-bin and non cgi-bin directory.
What do this file ned to be done to work properly?
I want to use mod_rewrite URL to make dynamic site spider friendly.
0
tilmesAuthor Commented:
Do i need also configure httpd.conf file?
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

ahoffmannCommented:
> Do i need also configure httpd.conf file?
yes, you need at least:
  AllowOverride AuthConfig
in each <Directory ...> where you want .htaccess
0
tilmesAuthor Commented:
Could you please check two file?
It doesn't work now with those two.

### In httpd.conf
AllowOverride AuthConfig
<Directory /homepages/22/d234234/htdocs/tell/scripts/DT_php>
Options ExecCGI FollowSymLinks Includes MultiViews
</Directory>

### In .htaccess
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule detail/(\.*)/(\.*)/$ /tell/scripts/DT_php/detail\.php?$1=$2
0
_nn_Commented:
ahoffman is 100% correct : "you need at least 'AllowOverride AuthConfig' *IN* each <Directory ...> (...)"
Moreover, you'll see at http://httpd.apache.org/docs-2.0/mod/core.html#allowoverride that this directive *cannot* be used anywhere else than within a <Directory ...> section.

So if you're going to use it, try like this :

### In httpd.conf
<Directory /homepages/22/d234234/htdocs/tell/scripts/DT_php>
Options ExecCGI FollowSymLinks Includes MultiViews
AllowOverride AuthConfig
</Directory>

Now, I see a couple other problems in your directives :

>> RewriteRule detail/(\.*)/(\.*)/$ /tell/scripts/DT_php/detail\.php?$1=$2

1. The 'left' expression : detail/(\.*)/(\.*)/$ is a regular expression.

\. => means "the dot character"
. => means "any character" (usually, but the end-of-line one)

So, your regexp will match /detail/.................../...../  (is this the URLs you want to use ?), but will fail to match anything else like /detail/xxx/yyy/ or /detail/blah/blurps/

2. The 'right' experssion is NOT a regular expression, so you don't need to 'escape' the dots.

In the end, it gives when corrected:

RewriteRule detail/(.*)/(.*)/$ /tell/scripts/DT_php/detail.php?$1=$2


Last problem is where you put the .htaccess file itself. For such a RewriteRule, it needs to be either in / or in /detail (not sure), but certainly not in the /tell/scripts/DT_php/ one.

HTH
0
tilmesAuthor Commented:
Thank you. I really tried a lot but it dosen't work.
The original URL is like
http://www.abcd.de/tell/scripts/DT_php/index.php?kid=12&catname=Medical+%26+Health
http://www.abcd.de/tell/scripts/DT_php/detail.php?siteid=1304

and in the .htaccess is;
Options +FollowSymLinks
RewriteEngine on

RewriteBase /
RewriteRule tell/(.*)/(.*)/$ /tell/scripts/DT_php/detail.php?$1=$2
RewriteRule tell/(.*)/(.*)/$ /tell/scripts/DT_php/index\.php?$1=$2&$3=$4

I put the httpd.conf in /
and .htaccess tried both in / and /tell/scripts/DT_php/
0
_nn_Commented:
httpd.conf should not be copied in the DocumentRoot or in any subfolder.

In httpd.conf :

<Directory /homepages/22/d234234/htdocs/tell>
Options ExecCGI FollowSymLinks Includes MultiViews
AllowOverride All
</Directory>

In /homepages/22/d234234/htdocs/tell/.htaccess :

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^/tell/(.*)/(.*)/$ /tell/scripts/DT_php/detail.php?$1=$2 [L]

Now, please try http://www.abcd.de/tell/siteid/1034/

Btw, are you sure mod_rewrite is loaded ?
0
tilmesAuthor Commented:

<httpd.conf should not be copied in the DocumentRoot or in any subfolder.>
Where can i put otherwise httpd.conf? I don't have access to httpd.conf in server
because i get hosting service. I am sure they suppot rewrite mode and below is fag. from the company.
http://faq.puretec.de/skripte/php/10.html

I followed exactly yours.
I got a error 404 in
http://www.abcd.de/tell/siteid/1034/
0
_nn_Commented:
If it's a hosting service, then you most likely don't have access to the httpd.conf file and creating one will not help at all.

Is abcd.de your domain name ? Because http://www.abcd.de/ doesn't work either, I can't even connect to the httpd daemon...
0
tilmesAuthor Commented:
can i make it wotj with httpd.conf?

Please look at under the address
http://www.widmen.de/jula/scripts/DT_php1
0
ahoffmannCommented:
> I don't have access to httpd.conf in server
you're lost
the server admin must enable .htaccess for you
0
_nn_Commented:
Is this puretec.de your hosting company ? If yes, did you simply try to follow that faq ? Something like

- no httpd.conf
- in the .htaccess file in your DocumentRoot folder :

RewriteEngine on
RewriteCond %{REQUEST_URI} tell/(.*)/(.*)/$
RewriteRule tell/(.*)/(.*)/$ /tell/scripts/DT_php/detail.php?$1=$2 [L]
0
tilmesAuthor Commented:
i don't know why, it doesn't work either.
0
_nn_Commented:
Well then, you need to contact your hosting company to see what's going wrong here.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ahoffmannCommented:
hmm, isn't the graded answer not a copy of my last one?
To all your questions I suggested that you need to modify httpd.conf.

Please take care when grading.
0
tilmesAuthor Commented:
I am sorry if something went wrong hoffmann.
How can i modify httpd.conf.?
There are already in httpd.conf
<Directory /homepages/22/d234234/htdocs/tell>
Options ExecCGI FollowSymLinks Includes MultiViews
AllowOverride All
</Directory>
0
ahoffmannCommented:
Please reread this thread!
You have to have admin privileges to modyfy httpd.conf (which is used by the server).
Or you need to ask the server admin (or whoever at the ISP) to do it.

Wer lesen kann, ist eindeutig im Vorteil
;-)
0
_nn_Commented:
ahoffmann, sorry for the mess, I butted in because I noticed a couple other problems in the regexps, I of course wasn't trying to grab points.

tilmes, if contacting your hosting company helped you, then ahoffmann's comment should have been accepted as an answer, not mine. You can get a moderator to undo that acceptance, post a request in the Community Support area.

Last, I assume that this server has many websites, in which case you *CANNOT* modify the httpd.conf file yourself and creating one in your folders will *NOT* have any effect.

Das Sprichwort kannte ich nicht, ist das ein "Klassiker" (es klingt so) ? (bin selber Franzose, kann aber ein wenig deutsch)
0
ahoffmannCommented:
I don't care about the points, just to clarify what was the most helpfull answer, at least for future readers.
(Non, ce ne pas un proverbe, est plus comme une phrase, parsque tout le mond savoir ecrivé :-))
0
joesremackCommented:
I am unable to url rewritting using php smarty.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.