Jump to content

Recommended Posts

Posted

Hey Mike. Here's an interesting problem for you to decipher.

 

I have the following rewrite rule:

 

>RewriteRule ^/*gamesdirectory/+(.*)\.html$ http://www.omgn.com/gamesdirectory.php?Item_ID=$1 [NE]

 

It doesn't work. Putting in "http://www.omgn.com/gamesdirectory/17.html" gets you to "http://www.omgn.com/gamesdirectory.php17.html?Item_ID=17"

 

However, I have tried replacing the rewrite rule with:

 

>RewriteRule ^/*gamesdirector/+(.*)\.html$ http://www.omgn.com/gamesdirectory.php?Item_ID=$1 [NE]

 

Using the address without the ending 'y' works. I have modified that thing all over the place and they all work: but using the full "gamesdirectory" doesn't.

 

Ideas?

Posted

I don't really see any issue with the first rewrite rule.

 

I took your rewrite rule and tried it and it works just fine for me. I created a .php file just to output some info on the call:

 

>.htaccess:

RewriteEngine On
RewriteRule ^/*gamesdirectory/+(.*)\.html$ http://www.testmonkey.ws/gamesdirectory.php?Item_ID=$1 [NE]

Requested URL: /gamesdirectory/17.html
File actually served: /gamesdirectory.php
Arguments Passed: Item_ID=17

 

For the moment I have it still available if you want to try it yourself.

 

http://testmonkey.ws/gamesdirectory/25.html

 

Change the 25 to whatever.

 

For reference, this is my gamesdirectory.php contents:

><html>
<body>
.htaccess:
<hr>
<pre>
<?php include('.htaccess'); ?>
</pre>
<hr>
<p>
<?php
   print("Requested URL: ".$REQUEST_URI."<br>File actually served: ".$PHP_SELF."<br>Arguments Passed: ".$QUERY_STRING);
?>
</body>
</html>

Posted

Two questions....

 

1. Does it work for you when you hit my URL?

2. Do you have other rules in your .htaccess file?

Posted

1) Yes, yours works.

2) I have other rules in my HTACCESS... Including the image protection we ironed out awhile back, I have the following ones right before the gamesdirectory rule, same format:

 

>RewriteRule ^/*news/+(.*)\.html$ http://www.omgn.com/news.php?Item_ID=$1 [NE]
RewriteRule ^/*reviews/+(.*)\.html$ http://www.omgn.com/reviews.php?Item_ID=$1 [NE]
RewriteRule ^/*editorials/+(.*)\.html$ http://www.omgn.com/editorials.php?Item_ID=$1 [NE]
RewriteRule ^/*interviews/+(.*)\.html$ http://www.omgn.com/interviews.php?Item_ID=$1 [NE]

 

I'm slowly getting things added to be more search-engine friendly (And making them seem like permanent URLs for my Print/Save/Newsfeeds functions)...

Posted

I'd recommend, just to test it, removing the other rules to see if somehow you have another rule that's also getting applied. That'll help narrow it down.

Posted (edited)

A new interesting development:

 

>RewriteRule ^/*(announcements|news|reviews|editorials|interviews|gamesdirectory)/+(.*)\.html$ http://www.omgn.com/$1.php?Item_ID=$2 [NE]

 

That works for all of the following:

 

http://www.omgn.com/announcements/9.html

http://www.omgn.com/news/9.html

http://www.omgn.com/reviews/9.html

http://www.omgn.com/interviews/8.html

http://www.omgn.com/editorials/9.html

 

And not the following:

 

http://www.omgn.com/gamesdirectory/9.html

 

Try them and see... I'm thinking it may be something in my PHP script, but I wouldn't know what...

Edited by TCH-Robert

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...