gerbz / Yourls-Swap-Short-Url

Swap out the shorturls created by yourls if you want to point them somewhere else.
11 stars 5 forks source link

urls under main domain are redirected to yourls link #11

Open ashokbugude opened 7 years ago

ashokbugude commented 7 years ago

I have website https://www.vgo.watch I have installed url shortner in https://www.vgo.watch/url

I have followed all the steps and am able to get url shortner working with shortened link as https://www.vgo.watch/[shortLink]

However , when I open other pages like https://www.vgo.watch/blog or https://www.vgo.watch/terms I am getting redirected to https://www.vgo.watch/url . How do I prevent this redirection .

I have tried modifying the .htaccess file as below

` RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule terms - [L] RewriteRule blog - [L] RewriteRule wp-admin - [L] RewriteRule wp-content - [L] RewriteRule wp-includes - [L] RewriteRule wp-login.php - [L] RewriteRule buywatch - [L] RewriteRule thank-you - [L] RewriteRule fr - [L] RewriteRule ^([0-9A-Za-z]+)/?$ https://vgo.watch/url/yourls-go.php?id=$1 [L] RewriteRule ^([0-9A-Za-z]+)+/?$ https://vgo.watch/url/yourls-infos.php?id=$1 [L] RewriteRule ^([0-9A-Za-z]+)+all/?$ https://vgo.watch/url/yourls-infos.php?id=$1&all=1 [L] RewriteRule . /index.php [L]

`

Now Everything works fine, but google or facebook cannot index the the sub pages like https://www.vgo.watch/blog or https://www.vgo.watch/terms as they return 404 error due to the rules

RewriteRule terms - [L] RewriteRule blog - [L]

Please help me in resolving the issue ?

MCLegoMan commented 3 years ago

I have a simular issue.

drbeco commented 2 years ago

Same issue here.

If I enter http://domain/en/home = wordpress works fine. But, if I enter just: http://domain it redirects to http://url.domain It should instead, open the home page under wordpress responsibility.

A bit hard to get this .htaccess working to not conflict with wordpress.

I read this answer here, and mostly people are giving up.

https://stackoverflow.com/questions/36223685/how-can-wordpress-and-yourls-peacefully-coexist-at-the-root-level

I hope to find a solution

drbeco commented 2 years ago

I finally solved the problem with YOURLS swap plugin and Wordpress. Here is the solution:

https://stackoverflow.com/questions/36223685/how-can-wordpress-and-yourls-peacefully-coexist-at-the-root-level/73516195#73516195