Limited-Time Donation Special!
Upgrade to Snow for $20 USD and receive a free copy of Oblivion Light ($5 discount).
Upgrade to +Blizzard for $35 USD and receive a free copy of Oblivion Light ($15 discount).

Please visit the thread below for more details.
CLICK HERE

Contact @Davlin with questions or comments.

Jump to content
gooboy

htaccess remove numbers from url

Recommended Posts

gooboy    0

Hi. I'm trying to remove the index numbers from my website's url using mod_rewrite. Everything I try inevitably fails so I'm posting here in the hopes someone knows the correct solution.

My url looks like this:

example.com/forum/1-general-discussion/

and my I want it to look like this:

example.com/forum/general-discussion/

My .htaccess file is currently:

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

 

Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites
gooboy    0

Found a way to edit it without modifying the .htaccess file. I just had to remove the {id} brackets found in the friendlyurl section of the AdminCP.

Share this post


Link to post
Share on other sites
mr-pimpen    39
On 5/13/2018 at 9:46 PM, gooboy said:

Found a way to edit it without modifying the .htaccess file. I just had to remove the {id} brackets found in the friendlyurl section of the AdminCP.

watch what you change it will hurt your forums i have done the same thing and it caused issues with the forums

Share this post


Link to post
Share on other sites
On 5/14/2018 at 2:46 AM, gooboy said:

Found a way to edit it without modifying the .htaccess file. I just had to remove the {id} brackets found in the friendlyurl section of the AdminCP.

I would not advise to do this and there is 2 reasons for it.

1) SEO. SEO is importent for Google and it will read the file, the only reason the number is there is to identify the board and make it unique. This connects to point 2)

2) Lets say the a scanario, you create general-chat now in another board you create general-chat for this.

This will then confuse the app as it does not know which one you are refering to. Top it off even google will start penalize you as you are loop linking and this is not something google links.

Glad you fixed the issue but again have a note on those two things.

  • Thanks 1

Share this post


Link to post
Share on other sites
gooboy    0
On 5/19/2018 at 3:06 PM, Cookie Monster said:

I would not advise to do this and there is 2 reasons for it.

1) SEO. SEO is importent for Google and it will read the file, the only reason the number is there is to identify the board and make it unique.

2) Lets say the a scanario, you create general-chat now in another board you create general-chat for this.

This will then confuse the app as it does not know which one you are refering to. Top it off even google will start penalize you as you are loop linking and this is not something google links.

Glad you fixed the issue but again have a note on those two things.

The id just trails after the topic name, something like this:

http://test.com/forum/general-discussion/?id=1

http://test.com/topic/-test-topic/?id=123

I haven't experienced any adverse effects.

 

 

Share this post


Link to post
Share on other sites
mr-pimpen    39

you will soon when updating the forums ipb  just give it a little time and you will see issues

Share this post


Link to post
Share on other sites
What do you think? Remember the human.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.

×