131
BelaS
Re: FAQ problem (strange URL)
  • 2004/3/4 15:19

  • BelaS

  • Just popping in

  • Posts: 62

  • Since: 2003/5/26


Quote:

reynaldo wrote:
Béla:

You can download ver 0.4 and then overwrite with fix #6. Please take in consideration you have to use both #6 files, xoops_shorturls.txt6 and loadpage.txt6

If you have any problems, let me know.


Thanks, Reynaldo. That's precisely what I did (I think) a few hours ago and the hack appears to be working very well. I've installed it on three production sites so far. One or two small hiccups which I'll pass on when I have a clearer idea as to what is happening.

Béla

132
BelaS
Re: FAQ problem (strange URL)
  • 2004/3/4 19:39

  • BelaS

  • Just popping in

  • Posts: 62

  • Since: 2003/5/26


Another thing. I'm well over my head, here, but in the spirit of adventure and in order to implement your hack I decided to drag one of my XOOPS sites out of the xoops/ subfolder, into which it had been foolishly installed, and place it at the site root. The path issues were mostly corrected by editing xoops/ out of mainfile.php, but I still had the issue of lots of pages that had already been spidered by Google and others, as well as hard-coded internal links, resulting in 404 errors. So I groped around apache.org a bit and added another rewrite rule to .htaccess, as follows:

RewriteRule ^xoops/(.*) http // www . internetadsales . com/$1 [L,R]

(spaces added to keep textsanitizer at bay)

The external redirect and the L command seemed to be the only way I could get it to work. So now a user clicking a URL such as:
http://www.internetadsales.com/xoops/modules/wfsection/article.php?articleid=13

will happily arrive at the correct page with the xoops/ stripped out, even though the xoops/ directory no longer exists on the server.

What I could not achieve was to find a solution that would allow your rewrite rules to go ahead and work their magic on the result of the xoops/ stripping rule, which is placed immediately before yours in .htaccess. I imagine this is due to the use of the external redirect, but other options seemed to confuse Xoops. Is there a better solution to the initial problem that would allow the subsequent rewrite rules to work as well?

This is my first stab at poking around mod_rewrite, so please pardon what may be a foolish question.

Thanks,

Béla

133
reynaldo
Re: FAQ problem (strange URL)
  • 2004/3/5 8:50

  • reynaldo

  • Not too shy to talk

  • Posts: 106

  • Since: 2004/2/13


Bela:

I'm glad everything is working excellent for you
I'm having the same results with my sites.
I noticed you mentioned you use XF/WF-Sections, does it works ok with my hack? I haven't tested it as if I remember correctly, it requires header.php file to be replaced with its own version.

About your question with Mod_Rewrite, I'm not a guru either, LOL, and I didn't quite understand your question, but if you meant you are trying to convert your old urls to ShortURLs format using Mod_Rewrite, I can't say it can't be done, but I think it would require lots of rules to be added into the .htaccess file

Or did you say that after the external redirect, my hack stops working?

134
BelaS
Re: FAQ problem (strange URL)
  • 2004/3/5 10:36

  • BelaS

  • Just popping in

  • Posts: 62

  • Since: 2003/5/26


Hi Reynaldo,

WFSection seems to work perfectly with the hack. The only module I've encountered trouble with so far is Glossary, and I think I've fixed that by adding a XOOPS_URL to some of the paths.

On the other question, what I was trying to do was to add one additional rule to .htaccess to strip the xoops/ out of the URL for a site that I had moved from a subdirectory into the root directory of the domain, i.e. fromhttp://www.internetadsales.com/xoops/ to just plainhttp://www.internetadsales.com. That rule, which I reproduced above, works by means of an external redirect flag on the RewriteRule. It seems to work successfully on that site (you can test by clicking the first link).

In theory, the way mod_rewrite works is to run through the list of rules in the order in which they are listed in .htaccess, so the requested URL should first get xoops/ stripped out of it, then the resulting URL should be modified by the changes applied in your hack.

However, in my frenzy of testing the only way that the initial rule seemed to work properly was by having both R and L flags applied to it. The R flag forces an external redirect, and the L flag, as I understand it, causes .htaccess to stop making changes to the URL when it is reached.

So, I was just wondering if you (and don't try to fool me with this "I'm no guru" stuff) knew of another way to strip the xoops/ out of the requested URL that would not require an L and R flag, and that would allow processing to continue through the changes applied by your hack?

I just reread this and realized I'm not quite sure what I'm looking for. Here's an attempt at an example:

Suppose Google has spidered an article in WFSection. The link on which the user would click is as follows:

http://www.internetadsales.com/xoops/modules/wfsection/article.php?articleid=13

When they get to the site, the rewrite rule I added removes the XOOPS from the URL, placing the user here:

http://www.internetadsales.com/modules/wfsection/article.php?articleid=13

which is the correct current location of wfsection. Users navigating internally, however, wind up at this URL:

http://www.internetadsales.com/m-wfsection+article+articleid-13.html

which is, of course, functionally identical. I think what I'm looking for is a way to make sure that a user clicking on the first URL doesn't wind up with the second one displayed in the address bar, but the third. In other words, that users are presented with the same URL whether they navigate to the page externally or internally. I don't suppose it matters that much, but it would make for a cleaner site and potentially improved search engine placements in the long run.

I'm not sure if that's any clearer. I find this whole business confusing, but I'm delighted that your hack seems to be working so well.

Cheers,

Béla

135
reynaldo
Re: FAQ problem (strange URL)
  • 2004/3/5 11:27

  • reynaldo

  • Not too shy to talk

  • Posts: 106

  • Since: 2004/2/13


Béla:

Quote:
...and don't try to fool me with this "I'm no guru" stuff...

No, I'm serious, I'm not!

Béla, what you want can be easily done but you have to add a rule for each url format. For example, for your URL above, try something like the following (I haven't tested this, it is just an example):

RewriteRule ^/xoops/modules/wfsection/article.php?articleid=([0-9]+)http://www.internetadsales.com/m-wfsection+article+articleid-$1.html [L,R=301]

136
BelaS
Re: FAQ problem (strange URL)
  • 2004/3/9 9:48

  • BelaS

  • Just popping in

  • Posts: 62

  • Since: 2003/5/26


Thanks again, Reynaldo. One more question: certain interstitial ad codes on my sites translate the + signs in the hacked URLs into %20, thus breaking the link. Would it damage anything in the way the hack works if I changed the + signs to - signs? And where would I change that?

Cheers,

Béla

137
BelaS
Re: FAQ problem (strange URL)
  • 2004/3/10 13:46

  • BelaS

  • Just popping in

  • Posts: 62

  • Since: 2003/5/26


And yet another question. After installing the hack, links to the site URLs that do not include the "www", e.g.http://internetadsales.com/whatever, of which there are many, no longer work, whereas they did previously. Any idea what may be the cause? And could there be a nice simple workaround?

Thanks again,

Béla

138
karuna
Re: FAQ problem (strange URL)
  • 2004/3/11 5:01

  • karuna

  • Not too shy to talk

  • Posts: 171

  • Since: 2002/5/29


Thanks for your great job.

I don't have a start module in my site,but when i click the Home,it takes me to the news module instead of go to the index.php

What should i do if i want the Home links to the index.php?

and at first i use loadpage.txt3 xoops_shorturls.txt3, there is a little error in the bottom of FAQ, then i use xoops_shorturls.txt6 loadpage.txt6 the little error in the FAQ disappeared but in the news module the print icon doesn't got a wrong url ashttp://domain/images/print.gif and the tell a friend icon is ok (http://domain.com/modules/news/images/friend.gif).


To see the error here ^^

139
eikke
Re: FAQ problem (strange URL)
  • 2004/3/11 7:35

  • eikke

  • Just popping in

  • Posts: 40

  • Since: 2004/1/15


Hi.

First of all, on my testsite, I'm using the 6th version of both loadpage.php and xoops_shorturls.php.
I'm also running XCGal on the site, and that module gets completely b0rked when using this hack. I'd love to be able to use the hack 'cause it's very usefull, but it's not working 100% right, so I just cannot use it

Please take a look at http://gao.eikke.com, and choose the "Gallery" module in the menu.
Then the link to "Album List"is not correct, the one to last uploads, comments,... too, to be short: almost nothing works correctly.

I enabled debug mode. Could you please take a look at this problem?

With kind regards, Ikke

140
karuna
Re: FAQ problem (strange URL)
  • 2004/3/11 11:28

  • karuna

  • Not too shy to talk

  • Posts: 171

  • Since: 2002/5/29


Quote:

BelaS wrote:
And yet another question. After installing the hack, links to the site URLs that do not include the "www", e.g.http://internetadsales.com/whatever, of which there are many, no longer work, whereas they did previously. Any idea what may be the cause? And could there be a nice simple workaround?

Thanks again,

Béla

I got the same problem, Now i use url redirection to make www.domain.com works.

Login

Who's Online

244 user(s) are online (158 user(s) are browsing Support Forums)


Members: 0


Guests: 244


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits